Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to compile gcc in Ubuntu

Shulou Source: shulou.com Published: 2022-05-31 21:30:18 10月04日 Update

This article mainly shows you "how to compile gcc in Ubuntu", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to compile gcc in Ubuntu" this article.

*, confirm that you have installed the build-essential package:

Apt-get install build-essential confirms that you have installed the kernel header package:

Uname-r

Apt-get install linux-headers-'kernel version' if you encounter an error in the Ubuntu gcc version, you need to install the gcc version that compiles your kernel:

Cat / proc/version this will tell you what version of Ubuntu gcc your kernel is compiled with.

$cat / proc/version

Linux version 2.6.12-8-386 (buildd@rothera) (gcc version 3.4.5 20050809 (prerelease) (Debian 3.4.4-6ubuntu6)) # 1 Tue Aug 30 22:41:30 BST 2005

Ls / usr/bin/gcc*

/ usr/bin/gcc / usr/bin/gcc-4.0 / usr/bin/gccbug / usr/bin/gccbug-4.0

As you can see, my core is compiled in Ubuntu gcc-3.4, but I only install gcc-4.0. If yours is also different from / usr/bin/gcc*, you need to install the version used by the core.

Apt-get install gcc-3.4 this is the version I need, yours may be different.

What people forget and what bothers me is the glossy + version. Some people seem to be able to install vmware-config.pl after installing Ubuntu gcc. But mine encountered a "cannot exec 'cc1plus'" error while compiling the vmmon module and stopped. What you need to install is the same version of gcc-c++, as Ubuntu gcc, except that Debian/Ubuntu calls it gaming.

Apt-get install glossary gcc 3.4 Editor add: I forgot you want to set Ubuntu gcc to the required version of gcc:

Export CC=/usr/bin/gcc-3.4

. / runme.pl

The above is all the content of the article "how to compile gcc in Ubuntu". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Version compilation content kernel article core error learning help different people just used file easy to understand more organization module knowledge program Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB NVidia Shulou Technology MySQL Apple