Visual Code intellisense problem


is there anything I can do to get Visual Code IntelliSense to find installed C++ libraries? My application builds and runs perfectly fine, but in the code editor, one library - FreeType - is not found. This is annoying since I don’t know this library very well and it slows down development.

I added find_package(Freetype REQUIRED) to my CmakeLists.txt and Freetype::Freetype to target_link_libraries. I don’t think there’s a problem with CMake as the project builds without problems.


Hi @mvandenabeele !

You said that your application builds successfully using FreeType lib/headers, right? So I’m assuming that you have no problem with your setup regarding adding this lib to your C++ project.

If you add this lib from the usual feeds (e.g. by adding its runtime package on extrapackages and its dev package on devpackages), then the headers should be in the default locations and VS Code should be able to find them.

But if you are making the headers available from some non-default path to you application, then you’ll need to explicitly inform VS Code about it. You can select C/C++: Edit Configurations (UI) from the Command Palette (Ctrl+Shift+P or simply F1) and scroll down to Include path and include the header’s path there. Be aware that the path must b written from the “point of view of the container”.

Let me know if this helps you.

Best regards,