g++ 4.6.2默认没有开启c++11,eclipse CDT怎么设置才好

ncnaf 2012-11-14 10:03:07
用eclipse CDT编写c++时,编译器是g++4.6.2,不过编译器默认没有启用c++ 11的特性,每次build时都通不过。

以下是示例代码:

#include <string>
#include <iostream>
#include <cctype>

using namespace std;
using std::string;

int main(int argc, char const *argv[])
{
string s1("hello,world!");
for(auto &a:s1){
a=toupper(a);
}
cout << s1 << endl;

return 0;
}


我只能到命令行去编译,编译时加上-std=c++0x
eclispe中可不可以设置成可以默认启用c++ 11
...全文
254 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
liubin9 2013-05-05
  • 打赏
  • 举报
回复
c/c++ build -> settings -> Gcc c++ compiler -> miscellaneous 中加入.
liubin9 2013-05-05
  • 打赏
  • 举报
回复
在工程里配置.

58,454

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧