"NS2" installs low version GGC under Linux

Source: Internet
Author: User

1, download the installation package, CD to the directory where the files

sudo dpkg-i gcc41-compat-4.1.2-ubuntu1210_i386.deb g++41-compat-4.1.2_i386.deb

2. View GCC installed to the system

ls/usr/bin/gcc*

3.

After downloading the package, it is recommended to install it directly with sudo dkpg-i *.deb

Because GCC installs with each other version of support, there are very frustrating order requirements, as if the installation system will automatically arrange the order of installation, more convenient

After installation, you need to set up the default GCC and g++ version (PS: The version of the settings here according to the version of the compiler in your system)

sudo update-alternatives--INSTALL/USR/BIN/GCC gcc/usr/bin/gcc-4.4 40
Update-alternatives: Using/usr/bin/gcc-4.1 to provide/USR/BIN/GCC (GCC) in automatic mode
sudo update-alternatives--install/usr/bin/gcc gcc/usr/bin/gcc-4.1 30
Update-alternatives: Using/usr/bin/gcc-4.4 to provide/USR/BIN/GCC (GCC) in automatic mode

Then set the default compiler, as follows:

sudo update-alternatives--config gcc


There are 2 options available for replacing the item gcc (provides/USR/BIN/GCC).

Select Path Priority state
------------------------------------------------------------
* 0/usr/bin/gcc-4.4 40 Auto mode
1/usr/bin/gcc-4.1 30 Manual Mode
2/usr/bin/gcc-4.4 40 Manual Mode

To maintain the current value [*] press ENTER, or type the number of your choice: 1

g++ 's setup page almost changed GCC to g++, as follows

sudo update-alternatives--install/usr/bin/g++ g++/usr/bin/g++-4.4 40
Update-alternatives: Use/usr/bin/g++-4.1 to provide/usr/bin/g++ (g++) in automatic mode
sudo update-alternatives--install/usr/bin/g++ g++/usr/bin/g++-4.1 30
Update-alternatives: Use/usr/bin/g++-4.4 to provide/usr/bin/g++ (g++) in automatic mode

Then set the default compiler, as follows:
sudo update-alternatives--config g++

There are 2 options available for replacing item g++ (providing/usr/bin/g++).

Select Path Priority state
------------------------------------------------------------
* 0/usr/bin/g++-4.4 40 Auto mode
1/usr/bin/g++-4.1 30 Manual Mode
2/usr/bin/g++-4.4 40 Manual Mode

To maintain the current value [*] press ENTER, or type the number of the selection: 1, so the basic setup is OK

"NS2" installs low version GGC under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.