Red Hat Enterprise Linux 6 Developer Guide
Total Page:16
File Type:pdf, Size:1020Kb
Red Hat Enterprise Linux 6 Developer Guide An introduction to application development tools in Red Hat Enterprise Linux 6 Dave Brolley William Cohen Roland Grunberg Aldy Hernandez Karsten Hopp Jakub Jelinek Developer Guide Jeff Johnston Benjamin Kosnik Aleksander Kurtakov Chris Moller Phil Muldoon Andrew Overholt Charley Wang Kent Sebastian Red Hat Enterprise Linux 6 Developer Guide An introduction to application development tools in Red Hat Enterprise Linux 6 Edition 0 Author Dave Brolley [email protected] Author William Cohen [email protected] Author Roland Grunberg [email protected] Author Aldy Hernandez [email protected] Author Karsten Hopp [email protected] Author Jakub Jelinek [email protected] Author Jeff Johnston [email protected] Author Benjamin Kosnik [email protected] Author Aleksander Kurtakov [email protected] Author Chris Moller [email protected] Author Phil Muldoon [email protected] Author Andrew Overholt [email protected] Author Charley Wang [email protected] Author Kent Sebastian [email protected] Editor Don Domingo [email protected] Editor Jacquelynn East [email protected] Copyright © 2010 Red Hat, Inc. and others. The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version. Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries. Linux® is the registered trademark of Linus Torvalds in the United States and other countries. Java® is a registered trademark of Oracle and/or its affiliates. XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries. MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries. All other trademarks are the property of their respective owners. 1801 Varsity Drive Raleigh, NC 27606-2072 USA Phone: +1 919 754 3700 Phone: 888 733 4281 Fax: +1 919 754 3701 Developer Guide This document describes the different features and utilities that make Red Hat Enterprise Linux 6 an ideal enterprise platform for application development. It focuses on Eclipse as an end-to-end integrated development environment (IDE), but also includes command-line tools and other utilities outside Eclipse. Preface vii 1. Document Conventions .................................................................................................. vii 1.1. Typographic Conventions .................................................................................... vii 1.2. Pull-quote Conventions ....................................................................................... viii 1.3. Notes and Warnings ............................................................................................ ix 2. Getting Help and Giving Feedback .................................................................................. ix 2.1. Do You Need Help? ............................................................................................. ix 2.2. We Need Feedback! ............................................................................................. x 1. Introduction to Eclipse 1 1.1. Understanding Eclipse Projects ..................................................................................... 1 1.2. Help In Eclipse ............................................................................................................ 3 1.3. Development Toolkits ................................................................................................... 5 2. The Eclipse Integrated Development Environment (IDE) 7 2.1. User Interface .............................................................................................................. 7 2.2. Useful Hints ............................................................................................................... 11 2.2.1. The quick access menu ................................................................................... 11 2.2.2. libhover Plug-in ................................................................................................ 17 3. Libraries and Runtime Support 21 3.1. Version Information ..................................................................................................... 21 3.2. Compatibility .............................................................................................................. 21 3.2.1. API Compatibility ............................................................................................. 22 3.2.2. ABI Compatibility ............................................................................................. 22 3.2.3. Policy .............................................................................................................. 22 3.2.4. Static Linking ................................................................................................... 23 3.3. Library and Runtime Details ........................................................................................ 23 3.3.1. The GNU C Library ......................................................................................... 23 3.3.2. The GNU C++ Standard Library ....................................................................... 26 3.3.3. Boost .............................................................................................................. 28 3.3.4. Qt ................................................................................................................... 31 3.3.5. KDE Development Framework .......................................................................... 32 3.3.6. Python ............................................................................................................ 34 3.3.7. Java ................................................................................................................ 35 3.3.8. Ruby ............................................................................................................... 36 3.3.9. Perl ................................................................................................................. 37 4. Compiling and Building 39 4.1. GNU Compiler Collection (GCC) ................................................................................. 39 4.1.1. GCC Status and Features ................................................................................ 39 4.1.2. Language Compatibility .................................................................................... 40 4.1.3. Object Compatibility and Interoperability ............................................................ 42 4.1.4. Backwards Compatibility Packages ................................................................... 43 4.1.5. Previewing RHEL6 compiler features on RHEL5 ................................................ 43 4.1.6. Running GCC .................................................................................................. 43 4.1.7. GCC Documentation ........................................................................................ 50 4.2. Distributed Compiling .................................................................................................. 50 4.3. Autotools .................................................................................................................... 50 4.3.1. Autotools Plug-in for Eclipse ............................................................................. 51 4.3.2. Configuration Script ......................................................................................... 51 4.3.3. Autotools Documentation ................................................................................. 52 4.4. Eclipse Built-in Specfile Editor .................................................................................... 52 5. Debugging 53 5.1. Installing Debuginfo Packages .................................................................................... 53 v Developer Guide 5.2. GDB .......................................................................................................................... 53 5.2.1. Simple GDB .................................................................................................... 54 5.2.2. Running GDB .................................................................................................. 55 5.2.3. Conditional Breakpoints ................................................................................... 57 5.2.4. Forked Execution ............................................................................................. 58 5.2.5. Threads .......................................................................................................... 58 5.2.6. GDB Variations and Environments .................................................................... 58 5.2.7. GDB Documentation ........................................................................................ 58 5.3. Variable Tracking at Assignments ...............................................................................