In ubuntu10.04, the default GCC version is GCC 4.4.1. Therefore, you must install the lower version of GCC 4.1.2. The installation steps are summarized as follows.
First download the required file. I downloaded the Deb package and the address
Http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.1/
. Download files as shown in
Install these packages, it
There is a dependency between them. If the order is not correct, a prompt is displayed. The installation command is sudo dpkg-I.
Xxx. Deb. Don't use sudo. Don't know. Don't try. The Approximate sequence is the fourth, the first, the third, the second, and the fifth, but the Second and the Fifth are mutually dependent, and the last two are input at a time.
File. In fact, later I found that I could use the dummies method, for example, it was entirely determined by the system itself,
At this time, there will be two versions of GCC in the system, the default is the original default GCC 4.4.1, we can change the default configuration of the system. View GCC version information
We can see that two versions of GCC have been installed successfully.
Added options for GCC 4.1.2 and GCC 4.4.1.
Set the default compiler, as shown in figure
In this way, the installation and default configuration are completed, so you can use GCC 4.1.2 by default to compile the program. Other versions are similar...
It is best to i486-linux-gnu-gcc, i486-linux-gnu-g ++ is also reconfigured, written as a shell directly configured.