c++cmakeconan

Linking Conan Include to VS Code


I'm currently using Conan on a C++ project using sqlite_orm as a dependency.

When using my personal include (like myClass.hpp for example) Visual Studio Code is able to provide auto-completion but with Conan's include, no auto-completion is possible.

I'm looking for a way to link the include path of Conan to my VSCode, any idea?


Solution

  • Add the following line in your project's .vscode/c_cpp_properties.json file

    For older versions:

    "includePath": ["${workspaceFolder}/**", "~/.conan/data/**"]

    For conan v2:

    "includePath": ["${workspaceFolder}/**", "~/.conan2/**"]