Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Eclipse CDT How to add gcc 4.6.3

I am running Eclipse CDT in Redhat Enterprise, the default version of gcc compiler is 4.4.6. The support team added gcc 4.6.3 recently, I am wondering how can I set up Eclipse in such a way that I can choose to compile the application with either gcc 4.4.6 or 4.6.3.

Thanks.

like image 577
2607 Avatar asked Mar 23 '12 13:03

2607


2 Answers

If you really want both gcc 4.6 and 4.4 in your eclipse, you will have to adjust your build configurations (as far I know there is no "easy" way to do this by default).

Project -> Properties -> C/C+++ Build -> Manage Configurations -> create new

Once this is created (& selected) you set it just like other configurations in tree (Debug / Release).

new_configuration > Discovery -> Compiler invocation command --> set path to gcc 4.6

I believe you have to do this per each project, Eclipse is sloppy in this area.

like image 180
Tomas Pruzina Avatar answered Oct 23 '22 10:10

Tomas Pruzina


I've just follow this SO post and done that succesfully for Eclipse empty make project. Try adding or editing PATH variable under "Project property" => "C/C++ Build" => "Environment". This way you don't need to alter environment variable outside the Eclipse.

like image 1
chanp Avatar answered Oct 23 '22 09:10

chanp