I want to install gcc 4.1.2 on my Ubuntu 64 bit system, which currentcly has gcc 4.4. I want to keep on using the current gcc, but want to add gcc 4.1.2 as well. Any simple way to do it, that is install gcc 4.1.2 on my system?
Easy, just take it from an archive of the older Ubuntu releases. For example, my machine (still running natty) has
edd@max:~$ ls -l /usr/bin/g++-*
-rwxr-xr-x 1 root root 242752 2010-09-10 04:16 /usr/bin/g++-4.3
-rwxr-xr-x 1 root root 263240 2011-03-31 15:22 /usr/bin/g++-4.4
-rwxr-xr-x 1 root root 275856 2011-04-18 09:25 /usr/bin/g++-4.5
edd@max:~$
The 4.1.* series had some issues. Even g++-4.2.1, the default on OS X, is not all that great. But you should definitely have the option of installing this.
When you do this, by all means go the package management route of installing proper dependencies. You will get matching packages for the other dependencies too.
In other words, you need to adjust /etc/apt/sources.list
to point to an older release that had this version.
sudo apt-get install gcc-4.1=4.1.2 gcc-4.4
seems the straightforward solution to me. Since @DirkEddelbuettel noted that newer Ubuntu distributions dropped it, add an older distribution that has gcc-4.1 to your /etc/apt/sources.list. The Ubuntu people maintain a great website for looking that up; hardy, lucid and maverick seem great.
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