为什么在g ++中-ansi和-std = c ++ 11会冲突? [英] Why do -ansi and -std=c++11 conflict in g++?

查看:88
本文介绍了为什么在g ++中-ansi和-std = c ++ 11会冲突?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

-ansi和-std = c ++ 11为什么不能一起使用?(根据其他答案,ANSI恢复为C ++ 98)我正在使用g ++-4.8.

Why does -ansi and -std=c++11 doesn't work together ? (ANSI reverts back to C++98 according to other answers) I am using g++-4.8.

这是C ++ 11的ANSI批准:

Here is the ANSI ratification of C++11 :

http://webstore.ansi.org/RecordDetail.aspx?sku = INCITS%2fISO%2fIEC + 14882-2012

这让我感到困惑.谢谢!

This leaves me perplex. Thanks!

推荐答案

RTFM :

-ansi
在C模式下,这等效于 -std = c89 .在C ++模式下,它等效于 -std = c ++ 98 .

-ansi
In C mode, this is equivalent to -std=c89. In C++ mode, it is equivalent to -std=c++98.

在标准的多个版本之前添加了该标志,并且该标志仍然具有相同的含义.

The flag was added before there were multiple versions of the standard, and the flag still has the same meaning.

您为什么仍要同时使用两者?如果您要 -std = c ++ 11 然后使用它,请不要添加另一个标志,它表示其他矛盾的地方.

Why do you want to use both anyway? If you want -std=c++11 then use that, don't add another flag that means something else contradictory.

这篇关于为什么在g ++中-ansi和-std = c ++ 11会冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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