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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With