Eclipse CDT C ++ 11 / C ++ 0x支持 [英] Eclipse CDT C++11/C++0x support

查看:168
本文介绍了Eclipse CDT C ++ 11 / C ++ 0x支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Eclipse 3.7.1
CDT 1.4.1
GCC 4.6.2

Eclipse 3.7.1 CDT 1.4.1 GCC 4.6.2

这是一个C ++ 11代码:

This is an example of a piece of C++11 code:

auto text = std::unique_ptr<char[]>(new char[len]);

Eclipse编辑器提示:

The Eclipse editor complains about:

Function 'unique_ptr' could not be resolved

Makefile编译工程精细。如何使Eclipse停止抱怨这些错误?

The Makefile compilation works fine. How to make Eclipse stop complaining about these sort of errors?

推荐答案

我发现这篇文章在Eclipse论坛,只是按照这些步骤,它适用于我。我在Windows上使用Cygwin设置使用Eclipse Indigo 20110615-0604。

I found this article in the Eclipse forum, just followed those steps and it works for me. I am using Eclipse Indigo 20110615-0604 on Windows with a Cygwin setup.


  • 创建一个新的C ++项目

  • 所有内容的默认选项

  • 创建后,右键单击项目并转到属性。

  • C / C ++ Build - >设置 - >工具设置 - > GCC C ++编译器 - >其他 - >其他标志。放置 -std = c ++ 0x (或对于较新的编译器版本 -std = c ++ 11 。...而不是GCC C ++编译器我也有Cygwin编译器

  • C / C ++通用 - >路径和符号 - >符号 - > GNU C ++。 c $ __ GXX_EXPERIMENTAL_CXX0X __ (确保在名称中附加并添加两个下划线)

  • Make a new C++ project
  • Default options for everything
  • Once created, right-click the project and go to "Properties"
  • C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> Miscellaneous -> Other Flags. Put -std=c++0x (or for newer compiler version -std=c++11 at the end . ... instead of GCC C++ Compiler I have also Cygwin compiler
  • C/C++ General -> Paths and Symbols -> Symbols -> GNU C++. Click "Add..." and paste __GXX_EXPERIMENTAL_CXX0X__ (ensure to append and prepend two underscores) into "Name" and leave "Value" blank.
  • Hit Apply, do whatever it asks you to do, then hit OK.

现在在Eclipse常见问题中也有对此的描述: Eclipse FAQ / C ++ 11功能

There is a description of this in the Eclipse FAQ now as well: Eclipse FAQ/C++11 Features.

Eclipse图片设置

这篇关于Eclipse CDT C ++ 11 / C ++ 0x支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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