linux 升级g++ [错误:unrecognized command line option “-std=c++11”]

出现这个编译错误的原因在g++ gcc 版本不够高。

添加源(Ubuntu)


1

2

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test

$ sudo apt-get update

安装4.8版本

?


1

$ sudo apt-get install gcc-4.8

g++-4.8

查看本地安装版本


1

2

3

$ ls -lh /usr/bin/g++*

这里应该可以看到本机安装了4.64.8两个版本。

切换版本


1

2

3

4

5

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8

sudo update-alternatives --config gcc

**选择4.8版本的序号**

再次查看g++版本


1

2

3

g++ --version

确认为 4.8 版本。

时间: 2024-08-29 08:34:06

linux 升级g++ [错误:unrecognized command line option “-std=c++11”]的相关文章

error: unrecognized command line option "-std=c11" 解决办法

今天在安装php版本 grpc扩展的时候报错如下: cc1: error: unrecognized command line option "-std=c11" cc1: warnings being treated as errors cc1: error: unrecognized command line option "-Wno-parentheses-equality" 开始搜寻解决方案,经查,出现这个 编译错误的原因在g++ gcc 版本不够高. 解决

在WSL中安装swool报错 error: unrecognized command line option '-V' 的解决方法

Windows Subsystem for Linux Ubuntu中使用pecl安装swool时遇到错误"error: C compiler cannot create executables"."error: unrecognized command line option '-V'" 解决方法 先看解决方法, 将gcc版本降低到4.8即可,因为高版本gcc取消了-V参数: sudo apt install gcc-4.8 -y sudo update-alte

安装SQL Servre2000时提示“command line option syntax error! type command /? for help”

问题: 当程序正在安装ms数据访问组件时,弹出错误提示框:command line option syntax error,type command/? for help,点击确定继续:到了程序正在安装HTML帮助时,弹出标题为html help 1.32 update错误提示框:command line option syntax error,type command/? for help,点击确定继续:程序开始复制文件,复制完后弹出错误提示框:无法找到动态连接库sqlunirl.dll(sq

linux下配置QT5.12 ERROR: Unknown command line option '-no-xcursor'.!

xcursor是个什么东西.为什么会报错,怎么处理!在qt的autoconfigure.sh中添加下三条命令都不行.提示不认识-no-xcursor或者不认识nomake命令. -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info -no-fontconfig \-nomake examples -nomake tools -nomake tests -no-iconv \ linux下配置QT5.12 ERR

Command line option syntax error.type Command /? for help

电脑装思维导图的时候,报错显示"Command line option syntax error.Type Command /? for help."就查了一下,原来是系统没有C++2005,需要安装,就上网下载了一个vcredist_x86.exe,但是双击安装,仍然出现这个错误. 没办法,接着上网查吧,是什么原因呢?网上说是因为该文件安装不支持中文安装路径,然后我就把文件夹改成了英文名称的,但是双击还是出现这个错误.可能有的人用这种方法成功了吧~本着没有解决不了的问题的思想,接着奋

“command line option syntax error,Type command/?for help

VS2010安装WDT时出现"command line option syntax error,Type command/?for help错误 解决:可能是因为你的安装源文件所在的路径中有中文,所以你可将安装文件放在一个没有中文的路径. "command line option syntax error,Type command/?for help,布布扣,bubuko.com

安装vcredist_x86,报错提示:Command line option syntax error.Type Command /?for Help

在安装loadrunner11的时候,提示缺少vc2005_sp1_with_atl_fix_redist组件,可以直接点击确定进行安装组件,或者进入loadrunner目录下lrunner\Chs\prerequisites\vc2005_sp1_redist手动安装vcredist_x86.exe,这时候出现了报错:Command line option syntax error.Type Command /?for Help 解决方案: 修改环境变量 修改完之后就可以正常安装啦 参考地址:

Linux 升级g++编译器(已经亲自验证)

开始入住这里,纪念一下!Linux命令太多了!慢慢积累 原版本低,提示要求g++8.2.0以的编译器.参考原文(https://www.cnblogs.com/furzoom/p/7710163.html) 1,用wget从 http://mirrors.ustc.edu.cn/gnu/gcc/ 下载所需要版本g++ 命令:wget   (Linux下载文件命令) 格式:wget+空格+参数+文件路径  wget [OPTION]- [URL]- 例:wget http://mirrors.us

〖Network〗linux pptp vpn connect via command line

关于使用命令行配置Ubuntu pptp vpn连接,网上有很多的资料: 但是要折腾起来还是需要花费很长时间的,现在已弄成了只需要几行命令就完事了: 1. 安装依赖软件: sudo apt-get install  pptp-linux 2. 使用pptpsetup来配置: sudo pptpsetup --create my_tunnel --server vpn.example.com --username alice --password foo --encrypt 3. 配置好路由策略: