Eclipse / Nsight (7.0) and C ++ 11 support
TL; DR:
How can I convince Nsight that I am using C ++ 11? In other words, where to set the appropriate detection parameters? Working with -std = C ++ 11 works even from within Eclipse. I'm talking about Indexer having definition issues.
Longer version:
C ++ 11 features are marked as unresolved in the Nsight editor because the __cplusplus definition is 199711L, not something> = 201103L.
When I made the project, an Project Properties > Build > Discovery Options
option Automate discovery of Path and Symbols
was checked for each language and each build configuration. There was a note at the bottom of the Properties window that said the detection method was out of date, so I unchecked the box for each language and for each build configuration.
Now, under Project Properties > General > Preprocessor Include Paths, Macros etc.
, there are system paths and defines (more precisely, provided by the Providers). I see the problematic __cplusplus in the list. I can override it according to the custom CDT settings and it will be the new value after rebuilding the index, but then whenever I click something in the editor, I get the error:
An internal error occurred during: "Notifying selection listeners".
org.eclipse.cdt.internal.core.index.composite.CompositingNotImplementedError
This route is of course a dead end. Another option is to define a new __cplusplus in Project Properties > General > Paths and Symbols
the Symbols tab. I also see the "wrong" __cplusplus. By overriding it, you will get the same error as above after rebuilding the index when clicking in the editor.
And what the hell is a CDT Managed Build Setting Entries
Provider? I don't see any options for this. Where is it configured?
When I try to use CDT GCC Built-in Compiler Settings
Provider, I see a box where I can enter command line arguments, but put -std = C ++ 11 has no effect since this entry does not create a __cplusplus definition.
Offtopic:
In other news, C ++ 11 support is great with the CUDA Toolkit 7.0, on the command line and in makefiles. It saddens me a lot that nVidia has settled on Eclipse. Whatever I did with it, I ran into an Eclipse issue. I need a week to set up an IDE for a project. I hate him so much.
source to share
I had a similar index problem when using my own compiler; however the cross compiler worked correctly. __cplusplus
Defined as 199711L when using native compiler , although C ++ dialect was set to C ++ 11 and index rebuilt.
The indexer can select C ++ 11 settings by selecting
Project Settings-> C / C ++ General-> Preprocessor Include Paths, Macros, etc-> Providers-> Inline CDT GCC Compiler Settings
and run:
- Clear the Use a global provider shared between projects check box.
-
Add
-std=c++11
to command to get compiler specs like this:${COMMAND} -std=c++11 ${FLAGS} ...
__cplusplus
must be properly installed.
source to share