gccLinux下安装GNU GCC编译器(linux安装gnu)

GNU GCC编译器是一个自由可源码的编程工具,可用于Linux系统。GCC是C/C++和Fortran等高级语言的编译器,为程序员提供了开发功能和优化技巧,帮助更好地编写代码。因此,安装GNU GCC编译器是加快应用程序开发的重要步骤。

在Linux下安装GNU GCC编译器的步骤很简单:

首先,打开终端并使用“sudo apt -get install gcc”命令安装GNU可执行文件。

然后,在命令行输入“gcc”,即可编译代码并显示版本信息:

[aaron@Xubuntu:~$ gcc

gcc (Ubuntu 7.4.0-1ubuntu1~16.04.4) 7.4.0

Copyright (C) 2017 Free Software Foundation, Inc.

This is free software; see the source for copying conditions. There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

最后,使用“gcc -v”来查看安装完成后的状态:

[aaron@Xubuntu:~$ gcc -v

Using built-in specs.

COLLECT_GCC=gcc

COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper

Target: x86_64-linux-gnu

Configured with:../src/configure -v –with-pkgversion=’Ubuntu 7.4.0-1ubuntu1~16.04.4′ –with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs –enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ –prefix=/usr –with-gcc-major-version-only –program-suffix=-7 –program-prefix=x86_64-linux-gnu- –enable-shared –enable-linker-build-id –libexecdir=/usr/lib –without-included-gettext –enable-threads=posix –libdir=/usr/lib –enable-nls –with-sysroot=/ –enable-clocale=gnu –enable-libstdcxx-debug –enable-libstdcxx-time=yes –with-default-libstdcxx-abi=new –enable-gnu-unique-object –disable-vtable-verify –enable-libmpx –enable-plugin –with-system-zlib –disable-browser-plugin –enable-java-awt=gtk –enable-gtk-cairo –with-java-home=/usr/lib/jvm/java-1.5.0-gcj-7-amd64/jre –enable-java-home –with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-7-amd64 –with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-7-amd64 –with-arch-directory=amd64 –with-ecj-jar=/usr/share/java/eclipse-ecj.jar –enable-objc-gc –enable-multiarch –disable-werror –with-arch-32=i686 –with-abi=m64 –with-multilib-list=m32,m64,mx32 –enable-multilib –with-tune=generic –enable-checking=release –build=x86_64-linux-gnu –host=x86_64-linux-gnu –target=x86_64-linux-gnu

Thread model: posix

gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~16.04.4)

以上就是在Linux下安装GNU GCC编译器的完整步骤,如果您有任何疑问,请随时与我们取得联系。


数据运维技术 » gccLinux下安装GNU GCC编译器(linux安装gnu)