您的位置:首页 > 运维架构 > Linux

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

2017-11-05 20:45 323 查看
http://blog.csdn.net/cbbbc/article/details/46464083

在linux系统下或者Centos7/Red Hat7企业版系统里如何安装gnu下的GCC编译器以及相关的工具呢?(autoconf,automake,flex,c++ compiler)

你需要安装包含下面的软件包的基本开发工具环境,那么就会自动安装好我们想要装gcc编译器:

autoconf

automake

binutils

bison

flex

gcc

gcc-c++

gettext

libtool

make

patch

pkgconfig

redhat-rpm-config

rpm-build

rpm-sign

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

# yum group install “Development Tools"


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

1

2

3

[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的版本号:

[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.

注意:如果出现没有 Jemalloc/jemalloc.h文件的错误时候,需要清除一下缓存。

make distclean


然后再make
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: