'Visual Studio Code include file not found in include directory (Windows 10)
I am trying to get intellisense in Visual Studio Code. I downloaded the the C/C++ extension from the marketplace: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools and also installed MinGW with the packages mingw32-base and mingw32-gcc-c++. I added the MinGW bin folder to Path in my Environment variables.
When I add any include statement in my .c file, such as #include <stdio.h>, Visual Studio Code says:
Include file not found in include directory
Am I not configuring correctly? How can I get intellisense for C/C++?
Solution 1:[1]
As an expansion to wbmrcb's answer, I found header files under Windows Kits directory:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\ucrt
Solution 2:[2]
On Fedora linux I added the following path where all my c header files lives.
/usr/include/**
to myc_cpp_properties.json file.
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include/**"
],
...
}
],
"version": 4
}
Solution 3:[3]
I am using MinGW 8.1.0 and the C/C++ extension from microsoft, this worked for me -
{
"configurations": [
{
"name": "Win32",
"includePath": [
"C:/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++",
"C:/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/tr1",
"C:/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/i686-w64-mingw32"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:/mingw32/bin/gcc.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-gcc-x64"
}
],
"version": 4
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | fatihpense |
| Solution 2 | syy |
| Solution 3 | Ninad Kulkarni |
