Eclipse CDT C ++ 11 / C ++ 0x支持

编程入门 行业动态 更新时间:2024-10-09 00:40:15
本文介绍了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上使用Eclipse Indigo 20110615-0604,配有Cygwin设置。

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 ++。单击添加...和粘贴 __ GXX_EXPERIMENTAL_CXX0X __ (确保附加并添加两个下划线)到名称中,并将值留空。
  • 点击申请无论它要求你做什么,然后点击OK。
  • 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 FAQ的描述: 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支持

本文发布于:2023-11-26 05:16:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1632779.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Eclipse   CDT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!