LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   installing a second (older) gcc/g++ version (how to configure) (https://www.linuxquestions.org/questions/linux-software-2/installing-a-second-older-gcc-g-version-how-to-configure-861099/)

r.stiltskin 02-06-2011 10:30 PM

installing a second (older) gcc/g++ version (how to configure)
 
I'm about to build gcc-3.3.6 from source, to install on my Ubuntu 10.04LTS system. I don't want it to interfere with the gcc-4.4.3 which was installed from the Ubuntu repos, so I think I should run configure with --prefix=/usr/local/gcc-3.3.6 to keep it separate and make it easy to remove. Does this seem OK or is there a better way?

Also, will this mean that whenever I want to compile with ver. 3.3.6, I MUST use the -I compiler option to specify the headers under my gcc-3.3.6 directory, or is it OK to skip that & let the preprocessor use the headers in /usr/include?

knudfl 02-07-2011 12:02 AM

Quote:

... or is there a better way ?
You can just install the gcc-3.3.6 from Ubuntu Hardy : gcc-3.3
http://packages.ubuntu.com/hardy-updates/gcc-3.3
http://packages.ubuntu.com/hardy-updates/g++-3.3
By adding 'hardy' to the sources.list , or manual install.

Ubuntu is meant to have multiple compilers installed.
You get : /usr/bin/gcc-3.3 : g++-3.3 .

Quote:

MUST use the -I compiler option
No, you always have the compiler headers in a non LD_LIBRARY_PATH.
gcc-<any-version> knows where its own headers are.
( Like /usr/lib/gcc/i486-linux-gnu/<version>/include/ ).

..


All times are GMT -5. The time now is 12:03 PM.