When setting includePath to paths from Windows Subsystem for Linux, the headers in it aren't recognized and causes errors like cannot find source file "stdio.h".
To reproduce, use the following c_cpp_properties.json with the user name and WSL system directory name replaced:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"C:/Users/Blealtan/AppData/Local/Packages/TheDebianProject.DebianGNULinux_76v4gfsz19hv4/LocalState/rootfs/usr/include",
"C:/Users/Blealtan/AppData/Local/Packages/TheDebianProject.DebianGNULinux_76v4gfsz19hv4/LocalState/rootfs/usr/local/include"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"C:/Users/Blealtan/AppData/Local/Packages/TheDebianProject.DebianGNULinux_76v4gfsz19hv4/LocalState/rootfs/usr/include",
"C:/Users/Blealtan/AppData/Local/Packages/TheDebianProject.DebianGNULinux_76v4gfsz19hv4/LocalState/rootfs/usr/local/include"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"cStandard": "c11",
"cppStandard": "c++17"
}
],
"version": 3
}
Then create a new C source file, add #include <stdio.h>, error occurs.
The file stdio.h does exist under specified include path:
PS C:\Users\Blealtan\AppData\Local\Packages\TheDebianProject.DebianGNULinux_76v4gfsz19hv4\LocalState\rootfs\usr\include> ls stdio.h
目录: C:\Users\Blealtan\AppData\Local\Packages\TheDebianProject.DebianGNULinux_76v4gfsz19hv4\LocalState\rootfs\usr\include
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2018/4/9 1:50 31494 stdio.h
Also, when setting log level to Information, it shows below messages:
Unable to retrieve file system information for C:/Users/Blealtan/AppData/Local/Packages/TheDebianProject.DebianGNULinux_76v4gfsz19hv4/LocalState/rootfs/usr/include. error = -1
Unable to retrieve file system information for C:/Users/Blealtan/AppData/Local/Packages/TheDebianProject.DebianGNULinux_76v4gfsz19hv4/LocalState/rootfs/usr/local/include. error = -1
I haven't faced with this issue before recently updating to latest Windows Insider (slow). Recent builds seems to have updated stuffs around the filesystem of WSL, which might be related.
Extra information:
- Operating System: Windows 10 Build 17127
- VS Code version: March 2018 (version 1.22, non-insider)
- C/C++ extension: Version 0.16.1
- Other extensions: unrelated; issue persists after disabled
When setting includePath to paths from Windows Subsystem for Linux, the headers in it aren't recognized and causes errors like
cannot find source file "stdio.h".To reproduce, use the following
c_cpp_properties.jsonwith the user name and WSL system directory name replaced:{ "configurations": [ { "name": "Linux", "includePath": [ "C:/Users/Blealtan/AppData/Local/Packages/TheDebianProject.DebianGNULinux_76v4gfsz19hv4/LocalState/rootfs/usr/include", "C:/Users/Blealtan/AppData/Local/Packages/TheDebianProject.DebianGNULinux_76v4gfsz19hv4/LocalState/rootfs/usr/local/include" ], "defines": [], "intelliSenseMode": "clang-x64", "browse": { "path": [ "C:/Users/Blealtan/AppData/Local/Packages/TheDebianProject.DebianGNULinux_76v4gfsz19hv4/LocalState/rootfs/usr/include", "C:/Users/Blealtan/AppData/Local/Packages/TheDebianProject.DebianGNULinux_76v4gfsz19hv4/LocalState/rootfs/usr/local/include" ], "limitSymbolsToIncludedHeaders": true, "databaseFilename": "" }, "cStandard": "c11", "cppStandard": "c++17" } ], "version": 3 }Then create a new C source file, add
#include <stdio.h>, error occurs.The file
stdio.hdoes exist under specified include path:Also, when setting log level to
Information, it shows below messages:I haven't faced with this issue before recently updating to latest Windows Insider (slow). Recent builds seems to have updated stuffs around the filesystem of WSL, which might be related.
Extra information: