Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

#include errors detected in vscode

I am using Visual Studio Code in my C++ project. I installed Microsoft C/C++ Extension for VS Code. I got the following error:

#include errors detected. Please update your includePath. IntelliSense features for this translation unit (/path/to/project/file.cpp) will be provided by the Tag Parser.

like image 937
banan3'14 Avatar asked Aug 09 '17 06:08

banan3'14


2 Answers

Close and re-open Visual Studio Code.

like image 107
Ivy Growing Avatar answered Sep 24 '22 01:09

Ivy Growing


The answer is here: How to use C/Cpp extension and add includepath to configurations.

Click the light bulb and then edit the JSON file which is opened. Choose the right block corresponding to your platform (there are Mac, Linux, Win32 – ms-vscode.cpptools version: 3). Update paths in includePath (matters if you compile with VS Code) or browse.paths (matters if you navigate with VS Code) or both.

Thanks to @Francesco Borzì, I will append his answer here:

You have to Left 🖰 click on the bulb next to the squiggled code line.

If a #include file or one of its dependencies cannot be found, you can also click on the red squiggles under the include statements to view suggestions for how to update your configuration.

enter image description here

like image 31
banan3'14 Avatar answered Sep 25 '22 01:09

banan3'14