无法识别的命令行选项& quot; -std = c ++ 11& quot;适用于GCC 4.8.1 [英] unrecognized command line option "-std=c++11" for GCC 4.8.1

查看:58
本文介绍了无法识别的命令行选项& quot; -std = c ++ 11& quot;适用于GCC 4.8.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在互联网上阅读了大量文献之后,似乎最新的GCC版本肯定支持 -std = c ++ 11 命令行选项.但是出于某种疯狂的原因,即使使用GCC 4.8.1,我也得到了无法识别的命令行选项".

After reading a lot of literature on the internet, it seems that recent GCC versions definitely support the -std=c++11 command line option. But for some crazy reason, I get the "unrecognized command line option" even when using GCC 4.8.1 which doesn't make any sense.

C:\newmingw\mingw32\bin>g++ -v
Using built-in specs.
COLLECT_GCC=g++
Target: i686-w64-mingw32
Configured with: [trimmed]
Thread model: win32
gcc version 4.8.1 (rev5, Built by MinGW-W64 project)

C:\newmingw\mingw32\bin>g++ -std=c++11 test.cpp
cc1plus: error: unrecognized command line option "-std=c++11"

在这里还有其他需要做的事情吗?TIA!

Is there anything else that needs to be done here? TIA!

推荐答案

我正在使用通过mingw-get从

I am using mingw obtained via mingw-get from http://www.mingw.org/wiki/Getting_Started
I can not confirm your problem. It might have something to do with your version being x64?

我的版本输出几乎相同:

My version output is nearly identical:

C:\>g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe
Target: mingw32
Configured with: [...]
Thread model: win32
gcc version 4.8.1 (GCC)

我目前正在将其用于一个大型项目,该项目使用了许多新的c ++ 11功能.

I am currently using this for a large project that uses a lot of the new c++11 functionalities.

这篇关于无法识别的命令行选项& quot; -std = c ++ 11& quot;适用于GCC 4.8.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆