Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How Linux upgrades or installs the gcc/g++ compiler environment

Shulou Source: shulou.com Published: 2022-06-02 07:26:14 11月12日 Update

This article introduces the knowledge of "how to upgrade or install the gcc/g++ compiler environment for Linux". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

First, check whether gcc,g++ exists.

# gcc-v

# glossy +-v

If both commands display version information, indicating that they are installed, you can skip step 2

Second, yum installs gcc gaming +

# yum-y install gcc

# yum-y install gcc-c++

If these two are not installed, an error will be reported when installing 6.1 later:

Checking how to run the C++ preprocessor... / lib/cpp

Configure: error: C++ preprocessor "/ lib/cpp" fails sanity check

See `config.log' for more details.

Finally, of course, it is the upgrading work.

# wget http://ftp.gnu.org/gnu/gcc/gcc-6.1.0/gcc-6.1.0.tar.gz / / download gcc-6.1.0.tar.gz

# tar-zvxf gcc-6.1.0.tar.gz / / decompress

# cd gcc-6.1.0 / / enter the gcc directory

#. / contrib/download_prerequisites / / download the corresponding dependent program

# mkdir build & & cd build / / create a new build directory and change to that directory

#.. / configure-enable-checking=release-enable-languages=c,c++-disable-multilib / / configuration

# make & & make install / / build and install

Be careful! It is best to use root permissions to install!

This is the end of "how to upgrade or install the gcc/g++ compiler environment for Linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Upgrades directories environments compilers compilers content more knowledge caching practicality learning and then information commands dilemmas reality that is situations articles times Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi MariaDB Docker macOS Linux