[C++] Include errors detected, cannot open source file "wchar.h" (dependency of "iostream")
After following the steps in "Using Clang in Visual Studio Code" section, I ran into an include error when adding a source code file in the very first line "#include
#include errors detected. Please update your includePath. IntelliSense features for this translation unit (projects/helloworld/helloworld.cpp) will be provided by the Tag Parser. cannot open source file "wchar.h" (dependency of "projects/helloworld/helloworld.cpp")
Any ideas on how to solve this issue?
@zry9056 is this the same wchar.h as the one in the C standard library, and is it in the default location? If so, are you seeing other headers? As a general rule, you should delete the "IncludePath" setting completely unless you have header files that are not in the standard locations or in your workspace folder.
I've seen this intermittently as well, but have been unable to diagnose the issue. In general I feel it would be nice for users to get better insight into where Intellisense runs afoul when searching for headers. I often see a green squiggly in the copyright comment in a header file with a highly generic error like:
#include errors detected. Please update your includePath. IntelliSense features for this translation unit (/path/to/main.cpp) will be provided by the Tag Parser.
When intellisense is in this bad state, the status bar icon still indicates "everything is fine", which seems strange.
@zry9056 sometimes it helps to open the problems pane with View: Focus Problems.
@zry9056 I'm closing this but feel free to reopen if you are still having problems.