PDA

View Full Version : Two g++ compilers active simultaneously. Help me understand



skwysham
10-Dec-2013, 17:07
SUSE 10 SP1 (yeah, old as the hills). I need g++ 3.3 and 4.1.2 active simultaneosly in order to migrate an application. I understand that having more than 1 compiler is "not possible." Please help me understand the reason behind this. Is it because of the rpm packaging, only, or is something more subtle at work? I've built gcc 4.1.2 with custom build options, but it seems that I should be able to rebuild just the rpms with edited directories, e.g. into /usr/local/bin instead of /usr/bin.

malcolmlewis
10-Dec-2013, 17:41
On Tue 10 Dec 2013 04:14:01 PM CST, skwysham wrote:


SUSE 10 SP1 (yeah, old as the hills). I need g++ 3.3 and 4.1.2 active
simultaneosly in order to migrate an application. I understand that
having more than 1 compiler is "not possible." Please help me
understand the reason behind this. Is it because of the rpm packaging,
only, or is something more subtle at work? I've built gcc 4.1.2 with
custom build options, but it seems that I should be able to rebuild just
the rpms with edited directories, e.g. into /usr/local/bin instead of
/usr/bin.




Hi
You can have multiple compilers installed, you just need to call them
when building.... for example;


export CC=/usr/bin/gcc43
export CXX=/usr/bin/gcc43-++

Then your Makefile should take care of it...

gcc and g++ are just symlinks to the installed compiler, you can always
change those links, but better to leave defaults and export as required.

--
Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
SLED 11 SP3 (x86_64) GNOME 2.28.0 Kernel 3.0.101-0.8-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below... Thanks!