For some reason VS-Code always complains that it cannot find the fstream header even though all other C++ standard library headers work perfectly fine. For example, the following code reproduces the issue:
#include <fstream> // "Include file not found in include directory"
#include <iostream> // no errors...
This happens on both Windows (using Visual Studio includes) and OpenSuse even though the fstream header is present in the include directory.
Not sure why we are seeing the behavior. Thanks for the report. We will investigate.
On my machine, it can't find any STL header

While the path is correct:

On Windows I had to change the slashes to backslashes and on Linux you have to add the include path for the STL headers (something like "/usr/include/c++/{version}") to get the headers (except for fstream) to work.
I have the same issue with #include <stdio.h> on Ubuntu 16.04. I get the message "_Include file not found in include directory_". The path in config file is correct:
{
"name": "Linux",
"includePath": ["/usr/include"]
}
$ ls -l /usr/include/stdio.h
-rw-r--r-- 1 root root 31365 dub 15 00:09 /usr/include/stdio.h
I'm able to compile and run the program.
Used SW:
Update: The issue doesn't happen in CPP 0.6.1
Well, I've just updated CPP extension to 0.6.1 and the issue has disappeared. So you can ignore my issue. Thanks.
@t-troebst do you still see the behavior with latest version of the extension?
No, at least on Linux it appears to work fine now.
Closing the issue. If you seen it in other contexts please reopen the issue
I'm seeing this on OSX with 0.7.1.

As for everyone above me, the path is correct:
{
"configurations": [
{
"name": "Mac",
"includePath": ["/usr/include"]
},
$ ls -l /usr/include/assert.h /usr/include/stdint.h
-r--r--r-- 1 root wheel 4197 Oct 28 2015 /usr/include/assert.h
-r--r--r-- 1 root wheel 5408 Oct 28 2015 /usr/include/stdint.h
Actually, I added a slash after /usr/include (to get /usr/include/) just for testing. It didn't make any difference, but once I removed the slash again and saved it magically started working. It is no longer telling me it can't find the headers.
I have Visual Studio Code version 1.3.1 installed on Windows 10 and still see this issue despite the fact that the path to the include directory is correct:
{
"name": "Win32",
"includePath": ["c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include"]
}
OK, I have managed to solve this issue on _Windows 10_. I found the answer on Microsoft's Visual Studio forum here.
The key was a quote from an article "Introducing the Universal CRT":
"The headers, sources, and libraries are now distributed as part of a separate
Universal CRT SDK. This SDK is included with Visual Studio; it is installed by
default to C:\Program Files (x86)\Windows Kits\10."
I needed to include an additional directory (besides the "c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include").
Look for the following directory on your computer:
C:\Program Files (x86)\Windows Kits\10\Include
If you have it, you may find several folders there. I chose the one that had the latest "Modified date". In there you'll find a ton of C headers. I ended up adding the following include directory (in addition to the existing one):
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/ucrt"
Here is an excerpt from my final configuration in the _c_cpp_properties.json_ (NB! use forward slashes in the path even on Windows):
{
"name": "Win32",
"includePath": ["c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/ucrt"]
}
No more complaining about "_Include file not found in include directory_" from Visual Studio Code!
I have the same issue:

SDL is in the right direcory (usr/include/SDL):


I have the same issue on El Capitan(10.11.6) running VSC 1.5.2
I had a similar issue to this on linux. I noticed that when I were to save the generated c_cpp_properties.json and restarted vscode, it started to work. So for all of you with issues, try the following to generate the json file as per the getting started guide here.
To enable code completion and navigation, you will need to generate a c_cpp_properties.json file:
1. Hover over any green squiggle in a source file (e.g. a #include statement). 2. Click the lightbulb that appears underneath the mouse cursor. 3. Click Add include path to settings.This will generate a c_cpp_properties.json file that allows you to add additional include paths to properly enable code navigation and auto-completion.
Save the file via the ctrl-s shortcut, and then restart visual code. You should get the autocomplete to start working at this point.
Same issue here; the problem would appear to be case differences in the file names.

all the includes are lower-case, but the files themselves are a mix of cases. If you rename the files to all lower and restart vscode, they are found.
On Linux, the #include paths are case-sensitive. It looks like we treat #include paths as case-sensitive on Windows too, but they are not. This might be a different issue from what others are reporting.
Actually, I was hitting a different bug in which duplicate missing #include are not marked. The case detection on Windows appears to be correct, so I'm not able to repro any casing problem on Windows. However, I'm seeing a problem in which certain workspaces don't recognize #include
Update 馃憤
I found out that my issue was caused by opening my cpp files from the operation system file system, Finder for Mac as an example. The problem disappeared when I opened the project folder using "Open Folder" then I selected my .cpps from there.
I hope this will help :)
Most helpful comment
Solution (for Windows)
OK, I have managed to solve this issue on _Windows 10_. I found the answer on Microsoft's Visual Studio forum here.
The key was a quote from an article "Introducing the Universal CRT":
I needed to include an additional directory (besides the "c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include").
Look for the following directory on your computer:
If you have it, you may find several folders there. I chose the one that had the latest "Modified date". In there you'll find a ton of C headers. I ended up adding the following include directory (in addition to the existing one):
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0/ucrt"
Here is an excerpt from my final configuration in the _c_cpp_properties.json_ (NB! use forward slashes in the path even on Windows):
No more complaining about "_Include file not found in include directory_" from Visual Studio Code!