错误:unrecognized command line option “

编程入门 行业动态 更新时间:2024-10-26 01:20:45

<a href=https://www.elefans.com/category/jswz/34/1771449.html style=错误:unrecognized command line option “"/>

错误:unrecognized command line option “

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

添加源

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

安装4.8版本

$ sudo apt-get install gcc-4.8 g++-4.8

查看本地安装版本

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

这里应该会看到本机装了4.6(自带)和4.8两个版本。

切换版本

$ 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++版本

$ g++ --version

确认当前版本为4.8,问题解决!

转自:

更多推荐

错误:unrecognized command line option “

本文发布于:2024-02-25 18:30:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1699902.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   unrecognized   command   line   option

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!