2607
2607

Reputation: 4115

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.

Upvotes: 8

Views: 33889

Answers (3)

chanp
chanp

Reputation: 675

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.

Upvotes: 1

Tomas Pruzina
Tomas Pruzina

Reputation: 8887

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.

Upvotes: 6

dbrank0
dbrank0

Reputation: 9476

I'm not sure you can have two versions configured in default CDT distribution. It will use the system default. What do you get if you do gcc -v? I guess 4.4.6. Put 4.6 in PATH before that, and it will use 4.6. And do restart eclipse, after you modify the path.

Also see this on how to clear project "discovery profile".

Upvotes: 0

Related Questions