04.06.2015 Views

Red Hat Developer Toolset 1.x User Guide - Linux

Red Hat Developer Toolset 1.x User Guide - Linux

Red Hat Developer Toolset 1.x User Guide - Linux

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

56 Chapter 10. Eclipse<br />

This installs eclipse-cdt, eclipse-jdt, eclipse-valgrind, and other packages to the system from the <strong>Red</strong> <strong>Hat</strong><br />

Enterprise <strong>Linux</strong> 6 x86/x86_64 Supplementary channel. To install all Eclipse packages, run as root:<br />

yum install eclipse-\*<br />

Note<br />

Eclipse is part of <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> rather than <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>. It is only<br />

available for <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 on 32-bit and 64-bit Intel and AMD architectures, and<br />

supports only C and C++ development. The <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> 6 version does not provide<br />

support for the Fortran programming language.<br />

10.2. Running Eclipse<br />

To start Eclipse with support for the GNU Compiler Collection and GNU Debugger from <strong>Red</strong> <strong>Hat</strong><br />

<strong>Developer</strong> <strong>Toolset</strong>, type the following at a shell prompt:<br />

scl enable devtoolset-1.1 'eclipse'<br />

This invokes the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> Eclipse IDE using the <strong>Developer</strong> <strong>Toolset</strong> gcc compiler and<br />

gdb debugger instead of the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalents.<br />

Important<br />

If you are working on a project that you previously built with the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> version<br />

of the GNU Compiler Collection, make sure that you discard all previous build results. To do so,<br />

open the project in Eclipse and select Project → Clean from the menu.<br />

You can execute any command using the scl utility, causing it to be run with the <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />

<strong>Toolset</strong> binaries used in preference to the <strong>Red</strong> <strong>Hat</strong> Enterprise <strong>Linux</strong> system equivalents. This allows<br />

you to run a shell session with <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong> gcc and gdb as the default compiler and<br />

debugger for Eclipse:<br />

scl enable devtoolset-1.1 'bash'<br />

Note<br />

To verify the version of gcc you are using at any point, type the following at a shell prompt:<br />

which gcc<br />

<strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong> <strong>Toolset</strong>'s gcc executable path will begin with /opt. Alternatively, you can use<br />

the following command to confirm that the version number matches that for <strong>Red</strong> <strong>Hat</strong> <strong>Developer</strong><br />

<strong>Toolset</strong> gcc:<br />

gcc -v<br />

During its startup, Eclipse prompts you to select a workspace, that is, a directory in which you want to

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!