Install GCC 4.1.2 on Ubuntu 14.04 LST
Gcc4.1.2 must be used to compile the source code software in Ubuntu 14.04 LST, but gcc4.8.4 has been installed on the local machine. When you download the gcc4.1.2 source code compilation, the system will always see that the library file cannot be found during running, or the i386 and x86_64 are not compatible. Answers to similar questions are provided online, and the installation is successful.
1. Download and decompress the source code
$ wget http://ftp.gnu.org/gnu/gcc/gcc-4.1.2/gcc-4.1.2.tar.bz2$ tar xvjf gcc-4.1.2.tar.bz2
2. Install dependency libraries and software
$ sudo apt-get install libc6-dev libgmp-dev libmpfr-dev texinfo
3. add links to header files and required Libraries
Add the following link, depending on your Ubuntu system architecture. If you are using a 64-bit ubuntu system, you should usex86_64-linux-gnu
Substitutioni386-linux-gnu
$ cd /usr/include$ sudo ln -s i386-linux-gnu/bits bits$ sudo ln -s i386-linux-gnu/gnu gnu$ sudo ln -s i386-linux-gnu/sys sys$ sudo ln -s i386-linux-gnu/asm asm$ cd /usr/lib$ sudo ln -s i386-linux-gnu/crt1.o crt1.o$ sudo ln -s i386-linux-gnu/crti.o crti.o$ sudo ln -s i386-linux-gnu/crtn.o crtn.o
4. Compile gcc
$ cd gcc-4.1.2$ mkdir build$ cd build$ ../configure --prefix=/usr/local --program-prefix=sse- --libexecdir=/usr/local/lib --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --enable-languages=c,c++$ make bootstrap
If the following error occurs:
WARNING: `makeinfo’ is missing on your system. You should only need it
if you modified a `.texi’ or `.texinfo’ file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy `make’ (AIX,
DU, IRIX). You might want to install the `Texinfo’ package or
the `GNU make’ package. Grab either from any GNU archive site.
Use the following command to compile:
$ make bootstrap MAKEINFO=makeinfo
5. Install gcc
$ make install$ cd /usr/local/bin$ ll *gcc*
You can see the following files, and the installation is complete.
i686-pc-linux-gnu-gcc-4.1.2 i686-pc-linux-gnu-ssegcc ssegcc ssegccbug
Linux GCC 4.8.1 clear and concise tutorial (Ubuntu 12.04 64-bit edition as an example)
Install and use Vim + GCC + GDB in Ubuntu
Switch two GCC versions in Ubuntu
CentOS6.5 upgrade to manually install GCC4.8.2
GCC details: click here
This article permanently updates the link address: