PDA

View Full Version : [SOLVED] multiple versions of gcc



monkeyking
November 24th, 2008, 03:10 PM
Is it possible to have multiple version of gcc installed on the same ubuntu installation.

And if so, how do I choose which to use.


thanks in advance

kjohansen
November 24th, 2008, 04:36 PM
http://www.linuxquestions.org/questions/slackware-14/multiple-versions-of-gcc-599326/

monkeyking
November 24th, 2008, 08:39 PM
This is exactly as complicated as I thought it would be.

I remember a java utility,
that made it possible to change version,
with the click of a button.

This would be nice

joseangelini
November 25th, 2008, 12:37 AM
perhaps you can use update-alternatives command. Look at this http://http://ubuntuforums.org/archive/index.php/t-80145.html

Good luck

wmcbrine
November 25th, 2008, 08:18 AM
It's not complicated, if you're using the multiple versions available from the Ubuntu repositories... all you have to do is invoke the non-default versions like so:

gcc-3.4

instead of just:

gcc

In a makefile, you should be able to achieve the same result by putting a line like "CC = gcc-3.4" at the top.

monkeyking
November 25th, 2008, 09:14 AM
gcc-3.4

Do you know,
if this approch will use the proper "old" includes?

dribeas
November 25th, 2008, 02:00 PM
Do you know,
if this approch will use the proper "old" includes?

I currently use g++ 3.4, 4.2 and 4.3 for development. Header files are not compatible and it works just fine.

monkeyking
November 25th, 2008, 02:57 PM
Thanks.