Search code examples
c++eclipseautocompletensightc++-chrono

Eclipse (Nvidia NSight 7.0) C++ chrono autocomplete


I am using the chrono library in a project and would like to enable autocomplete in eclipse. I've searched the internet, but failed to find a way to do so.

The IDE doesn't autocomplete std::chrono, neither system_clock.

I appreciate your help.

Thanks,

Igor Campos


Solution

  • With the following settings I made it partly work. Autocomplete works but only after manually adding the includes:#include <chrono> (same for other c++11 stuff like shared_ptr).

    You need to manually activate c++11 in the indexer. For nsight 7.0 you need to do the following steps:

    In the project properties go to:

    1. General -> Path and Symbols -> Symbols -> Add... -> Add the __cplusplus variable with the value 201103L (c++11). The default value will be overridden.
    2. General -> Preprocessor and Include Paths, Macro etc. -> Providers -> Activate CDT GCC Built-in Compiler Settings -> Decative Share setting entries between projects (global provider) -> To Command to get compiler specs: add -std=c++11 to the line.
    3. Apply changes and rebuild the index if not done automatically (right click on project -> Index -> Rebuild).

    The problem to solve is how to force the indexer to work even when the header is not included...