简体   繁体   中英

Manually set IntelliSense include directories (C++)

I'm using Vistual Studio Community 2019 to build (CMake) and debug C++ code . Compilation and debugging both happen in WSL and work fine. The problem is IntelliSense, which keeps complaining that it's not able to find the necessary headers.

Visual Studio is able to zip all necessary headers from the WSL and download it. I even checked the local copy folders to see if they were correct. And they are.

I even tried to mess around with CppProperties.json in order to point it to the downloaded headers (which should be done regardless), but with no success.

What am I missing?

I figured out what was happening.

IntelliSense needs the "full path" to the header file you're including. For instance, in my case, instead of using

#include <lua.hpp>

I had to use

#include <lua5.2/lua.hpp>

In order for it to work you have to have things set up as I described above. Feel free to comment if you're having trouble. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM