C++ 17 issue Intellisense

Sysprogs forums Forums VisualGDB C++ 17 issue Intellisense

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32165
    paulh001
    Participant

    I use visualgdb to develop for raspberry pi 4 bullseye.

    The steps I execute are

    1. Create a new linux project compile on raspberry pi and store files on Windows PC. Use MSBuils and Ninja as build tools
    2. Add some source code (does not matter as long correct C++ 1.7).  I copy a feature  test code from https://en.cppreference.com/w/cpp/feature_test
    3. Switch C++ compiler to C++17 with GNU extensions
    4. Now Intellisense suggest to add include files. (/usr/include/arm-linux-gnueabihf/c++/10;/usr/include/c++/10;/usr/include/c++/10/tr1;/usr/include/linux;%(ClCompile.AdditionalIncludeDirectories)_
    5. Compile code -> error /usr/include/c++/10/bits/move.h:76:27: error: ‘remove_reference’ in namespace ‘std’ does not name a template type
      76 | forward(typename std::remove_reference<_Tp>::type& __t) noexcept

     

    Intellisense has added the wrong include files. How to configure VisualGDB correct for C++17 ? Without intellisense adding the wrong include files all the time?

    Do I need to config intellisense also for C++17?

    Attachments:
    You must be logged in to view attached files.
    #32168
    paulh001
    Participant

    When I remove /usr/include/c++/10/tr1 it compliles ok. But intellisense keeps asking to add it

    #32175
    support
    Keymaster

    Hi,

    This looks like something specific to your target (e.g. some headers got moved or edited).

    The easiest way to fix it would be to delete the cached include directories for that target (via VisualGDB Project Properties or by deleting %LOCALAPPDATA%\VisualGDB\RemoteSourceCache\<hostname>) and rebuilding the MSBuild toolchain profile (VisualGDB Project Properties -> MSBuild -> Regenerate MSBuild Files).

    If it doesn’t help, please try locating the %LOCALAPPDATA%\VisualGDB\ToolchainProfiles\<hostname>\com.sysprogs.toolchain.default-gcc-\IntelliSense.props file. It contains the include directories and preprocessor macros used to configure IntelliSense based on various options (e.g. language standard). You can simply add the /usr/include/c++/10/tr1  directory to the AdditionalIncludeDirectories element (or even make it conditional on CPPLanguageStandard, similar to PreprocessorDefinitions). Editing the file and reopening the solution will make the directory visible to IntelliSense without affecting the build.

    #32176
    paulh001
    Participant

    Thanks, looks like rebuilding remote source cache did the trick.

     

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.