Fixing Intellisense

Sysprogs forums Forums VisualGDB Fixing Intellisense

This topic contains 23 replies, has 3 voices, and was last updated by  support 4 days, 20 hours ago.

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #21646

    JulianH93
    Participant

    Hello again,

    I always have problems with the intellisense engine of VisualGDB. After I included the C++ STL library “filesystem” almost the whole project got red underlined. Is there a way to fix such sings up? Or is this a known issue?

    It’s like the intellisense is somehow setting the __cplusplus macro wrong, so the #if in the filesystem-header fails:

    #ifndef _GLIBCXX_FILESYSTEM
    #define _GLIBCXX_FILESYSTEM 1

    #pragma GCC system_header

    #if __cplusplus >= 201703L

    #include <bits/fs_fwd.h>
    #include <bits/fs_path.h>
    #include <bits/fs_dir.h>
    #include <bits/fs_ops.h>

    #define __cpp_lib_filesystem 201703

    #endif // C++17

    #endif // _GLIBCXX_FILESYSTEM

     

    I don’t know why this is happening. The GCC Version on the target machine is 8.2 and everything is compiling fine.

     

    #21648

    support
    Keymaster

    Hi,

    Please ensure you are using the Clang IntelliSense provided by VisualGDB that is specifically optimized to handle GCC-specific code.

    If you are not sure, please attach a screenshot of the entire VS window showing the problem.

    If switching the IntelliSense engine doesn’t help, please let us know your project type (Make, CMake, MSBuild, QMake, etc) and we will provide more detailed diagnostic instructions.

    #21662

    JulianH93
    Participant

    I don’t really know how I may capture the whole error in one image. So here are some pictures.

    Where I suspect the error is in the filesystem-header, cause Intellisense isn’t parsing the header correctly:

    I estimate after I included this header, Intellisense bugged up:

    stdafx.h:

    The cpp file:

    IntelliSense Settings:

    • This reply was modified 2 months, 1 week ago by  JulianH93.
    #21674

    support
    Keymaster

    Hi,

    Thanks for the screenshots. Looks like the Clang IntelliSense is successfully initialized.

    Please try locating the following file:

    Does the __cplusplus value recorded there match what you expect? Are you using the correct “language standard” setting in VS Project Properties -> C/C++?

    #21701

    JulianH93
    Participant

    No, __cplusplus value does not hit my expecations.

    The highest I could find are:

    • This reply was modified 2 months ago by  JulianH93.
    • This reply was modified 2 months ago by  JulianH93.
    • This reply was modified 2 months ago by  JulianH93.
    #21710

    support
    Keymaster

    Hi,

    Thanks for checking it – that explains what is going on. Looks like VisualGDB indeed cached the values from the previous compiler.

    Please click “Regenerate MSBuild Files” on the MSBuild Settings page of VisualGDB Project Properties, or simply delete the IntelliSense.props file and reopen the project to regenerate the toolchain files.

    #21761

    JulianH93
    Participant

    Now the __cplusplus values are set correctly, but nothing changed. Intellisense is still not working correctly.

    #21763

    support
    Keymaster

    Hi,

    OK, please try isolating one specific case of broken IntelliSense (e.g. some variable or function is not found) and check if it’s still related to the mismatching __cplusplus definition, or something else (e.g. missing hardware/software FP macros). If you need more detailed instructions on this, please let us know a specific example of an IntelliSense error and we will help you narrow it down.

    #21975

    JulianH93
    Participant

    Now I replaced std::filesystem by boost::filesystem, but the errors are still there. Intellisense even can’t find #include <vector> in the stdafx.h (it’s the upper most header included, no more code before #include <vector>). In the meantime I switched my maschine, but the error still exists.

    “stdafx.h”:
    #pragma once

    #include <vector>
    #include <string>
    #include <cstdint>
    #include <memory>
    #include <iostream>
    #include <mutex>
    #include <thread>
    #include <iomanip>
    #include <atomic>
    #include <ctime>
    #include <queue>
    #include <ctime>
    #include <cstdio>
    #include <unordered_map>
    #include <chrono>
    #include <fstream>
    #include <utility>
    #include <optional>
    #include <boost/filesystem.hpp>
    #include <boost/asio.hpp>
    #include <boost/algorithm/string.hpp>
    #include <boost/program_options.hpp>
    #include <assert.h>
    #include <string.h>
    #include <unistd.h>
    #include <linux/can.h>
    #include <linux/can/raw.h>
    #include <signal.h>
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <sys/ioctl.h>
    #include <net/if.h>

    • This reply was modified 1 month ago by  JulianH93.
    #21990

    support
    Keymaster

    Hi,

    Strange. Could you please try locating the <vector> file manually (both on remote machine and locally in %LOCALAPPDATA%\VisualGDB) and check if the corresponding directory is listed on the IntelliSense Directories page?

    #21992

    JulianH93
    Participant

    vector on Windows maschine is in: \VisualGDB\RemoteSourceCache\192.168.0.138\0000\include\c++\8\vector

    vector on Linux maschine is in: /usr/include/c++/8/profile/vector

    And here is the IntelliSense Directory:

    right click on vector and try to open it:

    It says: “vector couldnt’t be found in the actual source directory or in the build system path. Actual source path: “source to the root path of my project” Buildsystempath is empty.

    • This reply was modified 1 month ago by  JulianH93.
    • This reply was modified 1 month ago by  JulianH93.
    #22000

    support
    Keymaster

    Hi,

    The error message looks like something shown by Visual Studio itself, not VisualGDB. It might indicate that IntelliSense is not properly initialized for the source file you are editing.

    Are you using the Clang IntelliSense? If not, does the problem get solved if you enable it? If yes, please share a screenshot of the entire VS window showing the source file you opened (including any navigation bars on top) so we could check which IntelliSense engine is handling it.

    #22017

    b.timofte
    Participant

    I had similar issue in the past . It looks like VisualGDB cannot handle Boost library template headers . I tried with REsharper c++ and was much better

     

    See my thread with Boost and Xerces 🙂

     

    xerces xml parser clang fail

    • This reply was modified 1 month ago by  b.timofte.
    #22020

    support
    Keymaster

    Hi,

    This is likely caused by a missing setting, or an incompletely imported project. We can help you get it to work if you could share the details we requested.

    #22019

    support
    Keymaster

    Hi,

    This is likely caused by a missing setting, or an incompletely imported project. We can help you get it to work if you could share the details we requested.

Viewing 15 posts - 1 through 15 (of 24 total)

You must be logged in to reply to this topic.