Skip to content Skip to main navigation Skip to footer

Linux/Centos:如何安装GCC(C和C++编译器)

linux系统下或者Centos7/Red Hat7企业版系统里如何安装gnu下的GCC编译器以及相关的工具呢?(autoconf,automake,flex,c++ compiler)
你需要安装包含下面的软件包的基本开发工具环境,那么就会自动安装好我们想要装gcc编译器:

  1.     autoconf
  2.   automake
  3.   binutils
  4.     bison
  5.     flex
  6.     gcc
  7.     gcc-c++
  8.     gettext
  9.     libtool
  10.     make
  11.     patch
  12.     pkgconfig
  13.     redhat-rpm-config
  14.     rpm-build
  15.     rpm-sign

输入下面的命令安装基本工具开发包:

# yum group install “Development Tools"
 

下一步可以用whereis gcc这个命令来验证是否安装成功:

[root@devops ~]# whereis gcc
gcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz
[root@devops ~]#
 

或者通过gcc家–version选项来查看gcc的版本号:
[cc lang=”bash] [root@devops ~]# gcc –version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.8.2-16)
Copyright (C) 2010 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.
[/code]

0 Comments

There are no comments yet

Leave a comment

Your email address will not be published.