在Anjuta 3.4.3中将-std = c ++ 11添加到编译器选项 [英] Adding -std=c++11 to compiler options in Anjuta 3.4.3

查看:75
本文介绍了在Anjuta 3.4.3中将-std = c ++ 11添加到编译器选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用GTKmm atm的项目中已经走了很远,我正在尝试添加一些代码,这是我的一个朋友正在从事的工作。但是,我收到此错误:

I'm fairly far in a project using GTKmm atm, and I'm trying to add in some code a friend of mine have been working on. However I'm getting this error:


error此文件需要ISO C ++ 2011标准的编译器和库支持。该支持目前处于试验阶段,必须使用-std = c ++ 11或-std = gnu ++ 11编译器选项启用

error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options

但是我找不到任何可以实际添加这些编译器选项的地方。

However I can't find anywhere that will actually let me add these compiler options.

将其添加到 Build->配置项目仅产生:
错误:无法识别的选项'std = c ++ 11'

任何对此IDE熟悉的人都可以提供帮助?

Anyone more familiar with this IDE who might be able to help?

推荐答案

请注意,命令行选项以-开头。因此,该选项为 -std = c ++ 11 (请参阅 man gcc )。

Note that the commandline options start with a '-'. So the option is -std=c++11 (See man gcc).

Build->中添加一个选项;配置项目必须像这样完成

CXXFLAGS='-std=c++11'

您也可以转到项目|项目选项,然后在顶部框中选择目标。一个选项应显示为更多选项。单击它,然后可以在要使用的选项字段中输入 -std = c ++ 11 (可能是 Compiler标志)。

You can also go to Project | Project options, then select your target in the top box. An options should appear 'More options'. Click on that, and you can enter -std=c++11 in the option field you want to use (probably Compiler flags).

它在这里有效,但我有 gcc 版本4.8.x

It works here, but I have gcc version 4.8.x

这篇关于在Anjuta 3.4.3中将-std = c ++ 11添加到编译器选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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