标签:
出现这个编译错误的原因在g++ gcc 版本不够高。
|
1
2
|
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test$ sudo apt-get update |
|
1
|
$ sudo apt-get install gcc-4.8 g++-4.8 |
|
1
2
3
|
$ ls -lh /usr/bin/g++*这里应该可以看到本机安装了4.6和4.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.6sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8sudo update-alternatives --config gcc**选择4.8版本的序号** |
|
1
2
3
|
g++ --version确认为 4.8 版本。 |
linux 升级g++ [错误:unrecognized command line option “-std=c++11”]
标签:
原文地址:http://www.cnblogs.com/zhuyaguang/p/4629815.html