CentOS
安装gcc©编译器使用命令:
yum -y install gcc
安装g++(c++)编译器使用命令:
yum -y install gcc-c++
(不能使用yum -y install g++,否则提示没有g++这个包名)
Ubuntu
-
先安装 :
sudo apt-get install build-essential
-
查看 gcc 版本 然后安装 统一版本的 g++
gcc --version
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
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.
-
安装 g++
sudo apt-get install g++-4.4
-
查看安装版本
g++ --version
g++ (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
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.