在Linux下我们将要使用gcc和g++来编写C/C++程序,首先使用yum安装gcc和g++:
yum install gcc gcc-c++
安装成功之后可以使用gcc -v和g++ -v来查看它们的版本号,以便确定安装它们是否已经安装成功:
gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/5.1.1/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c Thread model: posix gcc version 5.1.1 20150422 (Red Hat 5.1.1-1) (GCC)
g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/5.1.1/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c,c++ Thread model: posix gcc version 5.1.1 20150422 (Red Hat 5.1.1-1) (GCC)
Copyright © 2015-2023 问渠网 辽ICP备15013245号