使用命令查看g++版本。
复制代码
1
2
3
4
5
6
7
8root@ubuntu:/home/neo# g++ --version g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 Copyright (C) 2011 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. root@ubuntu:/home/neo#
ubuntu系统中是4.6.3版本,不支持c++11。-std=c++11至少需要4.8的版本
下载“gcc-4.8.2.tar.gz”安装包:
https://ftp.gnu.org/gnu/gcc/gcc-4.8.2/
下载完之后解压、运行脚本。
复制代码
1
2
3
4
5
6
7
8
9tar -vxf gcc-4.8.2.tar.bz2 cd gcc-4.8.2/contrib/ ./download_prerequisites cd .. mkdir __install cd __install/ ../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib make & make install
在运行上述命令过程中会报如下错误:
复制代码
1
2
3configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+. Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
解决办法:
https://blog.csdn.net/weixin_38184741/article/details/85858761
参考链接:
https://jingyan.baidu.com/article/15622f2435355dfdfcbea595.html
最后
以上就是搞怪蓝天最近收集整理的关于报错:unrecognized command line option ‘-std=c++11’的全部内容,更多相关报错:unrecognized内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复