#include errors detected in vscode
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 /kbd> 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.
#include errors detected based on information provided by the configurationProvider setting
You are trying to find file .../"maximum.h"
which obviously in not existing.
Use either <maximum.h>
which first will search your file inside compiler directories or "maximum.h"
which first will search near your current file.
Visual Studio Code gives me #include error detected for C
I have found the solution thanks to this video on how to Set Up C++ Development With Visual Studio Code on Windows 10 (VS Code).
I launched MinGW Installation Manager and installed all the package from the Basic Setup.
I added the path of the gcc compiler to my system´s environment variables:
C:\MinGW\bin
, in which is thegcc.exe
.I opened the c_cpp_properties.json file and added different paths for the folders I want to include. So now my
c_cpp_properties.json
file looks like this:{
"configurations": [{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.10240.0\\ucrt",
"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include",
"C:\\MinGW\\lib\\gcc\\mingw32\\6.3.0",
"C:\\MinGW\\lib\\gcc\\mingw32\\6.3.0\\include\\c++",
"C:\\MinGW\\lib\\gcc\\mingw32\\6.3.0\\include"
],
"defines": ["_DEBUG", "UNICODE", "_UNICODE"],
"intelliSenseMode": "clang-x64"
}],
"version": 4
}
Related Topics
How to Use Windbg to Analyze the Crash Dump for Vc++ Application
How to Solve the Error Lnk2019: Unresolved External Symbol - Function
Reduce Flicker with Gdi+ and C++
Templated Class Specialization Where Template Argument Is a Template
Reason for C++ Member Function Hiding
Debugging Information Cannot Be Found or Does Not Match Visual Studio'S
Correctly Reading a Utf-16 Text File into a String Without External Libraries
Why Not to Inherit from Std::Allocator
"Constexpr If" VS "If" with Optimizations - Why Is "Constexpr" Needed
Implementing Qt Project Through Cmake
Using Bitwise Operators for Booleans in C++
Get the Status of a Std::Future
Skipping Incompatible Libraries at Compile
Populate an Array Using Constexpr at Compile-Time
On Local and Global Static Variables in C++
In C++, How to Forward Declare a Class as Inheriting from Another Class