Eclipse / Nsight(7.0)和C ++ 11支持 [英] Eclipse/Nsight (7.0) and C++11 support

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

问题描述

如何说服Nsight使用C ++ 11?
换句话说,我在哪里设置相关的发现选项?
使用-std = c ++ 11构建工作,即使在Eclipse中也是如此。

How can I persuade Nsight that I'm using C++11? In other words, where do I set the relevant discovery options? Building with -std=c++11 is working, even from within Eclipse. I'm talking about the Indexer having troubles with defines.

C ++ 11函数在Nsight编辑器中被标记为未解决,因为__cplusplus定义是199711L,而不是> = 201103L。

C++11 functions are marked as unresolved in the Nsight editor, because the __cplusplus define is 199711L, instead of something >= 201103L.

当我做项目时,在项目属性>构建>发现选项对每种语言和每个构建配置检查了自动发现路径和符号选项。在属性窗口底部有一个注释,说发现方法已被弃用,所以我取消选中它为每种语言和每个Build配置。

When I made the project, in Project Properties > Build > Discovery Options the Automate discovery of Path and Symbols option was checked for every language and every Build Configuration. There was a note on the bottom of the Properties windows that said that the discovery method is deprecated, so I unchecked it for every language and for every Build Configuration.

现在, 项目属性>一般>预处理器包括路径,宏等。有系统提供的路径和定义(更精确地,由提供者提供)。在列表中我可以看到有问题的__cplusplus。我可以在CDT用户设置条目下重新定义它,实际上它将是重建索引后的新值,但是当我在编辑器中单击某个时,我得到一个错误:

Now, under Project Properties > General > Preprocessor Include Paths, Macros etc. there are system provided paths and defines (more precisely, provided by the Providers). In the list I can see the problematic __cplusplus. I can redefine it under the CDT User Setting Entries and indeed it will be the new value after rebuilding the Index, but then whenever I click something in the editor I get an error:

An internal error occurred during: "Notifying selection listeners".
org.eclipse.cdt.internal.core.index.composite.CompositingNotImplementedError

显然是一个死胡同。另一个选项是在项目属性>中定义新的__cplusplus。一般>在符号选项卡下的路径和符号。我可以看到错__cplusplus那里。重新定义它在那里给我与上面相同的错误,在重建索引后,当点击编辑器。

That route is a dead end obviously. Another option is to define the new __cplusplus in Project Properties > General > Paths and Symbols under the Symbols tab. I can see the "wrong" __cplusplus there as well. Redefining it there gives me the same error as above, after rebuilding the Index, when clicking in the editor.

此外,它是什么是 CDT管理构建设置条目提供程序?我没有看到任何选项。在哪里配置?

Also, what the hell is the CDT Managed Build Setting Entries Provider? I don't see any options for it. Where is it configured?

当我尝试使用 CDT GCC内置编译器设置字段,其中我可以输入命令行参数,但是输入-std = c ++ 11没有效果,因为该条目不产生__cplusplus定义。

When I try to use the CDT GCC Built-in Compiler Settings Provider I see a field where I can input command line arguments, but putting -std=c++11 there has no effect, as that entry doesn't produce a __cplusplus define.

在其他新闻中,C ++ 11支持CUDA Toolkit 7.0,在命令行和makefile中。它使我非常伤心,nVidia决定了Eclipse。无论我做了什么,我只遇到了Eclipse的麻烦。让我一个星期只是为一个项目设置IDE。

In other news, C++11 support is great with the CUDA Toolkit 7.0, on the command line and in the makefiles. It saddens me greatly that nVidia settled on Eclipse. Whatever I did with it, I've only encountered trouble with Eclipse. Takes me a week just to set up the IDE for a project. I hate it so much.

推荐答案

在使用本机编译器时,我遇到了与索引器类似的问题;但是,交叉编译器工作正常。当使用本地编译器时,即使C ++方言已经设置为C ++ 11并且重建索引, __ cplusplus 也被定义为199711L。

I experienced a similar problem with the indexer when using the native compiler; however, the cross compiler worked correctly. When using the native compiler, __cplusplus was defined as 199711L even though the C++ dialect had been set to C++11 and the index rebuilt.

索引器可以通过转到

项目设置 - > C / C ++ General-> Preprocessor Include Paths来获取C ++ 11设置,宏等等 - >提供程序 - > CDT GCC内置编译器设置

Project Settings->C/C++ General->Preprocessor Include Paths, Macros etc.->Providers->CDT GCC Built-in Compiler Settings

并执行:


  1. 取消选中使用项目之间共享的全局提供程序

  2. 添加 -std = c ++ 11 命令获取编译器规格

$ {COMMAND} -std = c ++ 11 $ {FLAGS} ...

__cplusplus 现在应该正确设置。

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

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