如何在gcc中使CodeBlocks与-std = c ++ 0x一起编译? [英] How can I get CodeBlocks to compile with -std=c++0x with gcc?
问题描述
我如何让CodeBlocks与-std = c ++ 0x一起在gcc中进行编译?
How can I get CodeBlocks to compile with -std=c++0x with gcc?
我想看看它们是否使用有用的语法突出显示来对待新功能。另外,我现在有很多东西n C ++-0x。
I would like to see if they treat new features with useful syntax highlighting. Also, I have a lot of stuff n C++-0x now.
推荐答案
简单:放 -std = c ++ 0x -U__STRICT_ANSI __
或 -std = gnu ++ 0x -U__STRICT_ANSI __
(如果您也想要GNU扩展)到任一项目的构建中选项(编译器,其他选项),或在 global 编译器选项(设置菜单)中进行设置。
Easy: Put -std=c++0x -U__STRICT_ANSI__
or -std=gnu++0x -U__STRICT_ANSI__
(if you want GNU extensions too) into either your project's build options (compiler, other options), or set them in the global compiler options (settings menu).
您需要取消定义 __ STRICT_ANSI __
,否则您会遇到一些遗留标头(我相信它主要是 stdio
),这些标头有时会包含在某些第三方代码中。
You need to undef __STRICT_ANSI__
or you get trouble with some legacy headers (I believe it's mostly stdio
) that are inevitably sometimes included from some 3rd party code.
这篇关于如何在gcc中使CodeBlocks与-std = c ++ 0x一起编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!