Home >Development Tools >VSCode >How vscode solves the problem that c++ cannot find the header file
It can be solved by modifying the configuration file. The specific method is as follows:
Create a new c_cpp_properties.json file in the .vscode folder
Paste the following code into it. Change the includePath option to the lib/gcc/x86_64-w64-mingw32/8.1.0/include folder path under the installation path of your mingw compiler.
{ "configurations": [ { "name": "Win32", "includePath": [ "C:/Program Files/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include" ], "defines": [ "_DEBUG", "UNICODE", "_UNICODE" ], "intelliSenseMode": "gcc-x64" } ], "version": 4 }
For header files in non-standard libraries, you can also append the path to includePath by appending the list
"includePath": [ "C:/Program Files/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include", "path1", "path2", ... ],
Recommended related article tutorials: vscode tutorial
The above is the detailed content of How vscode solves the problem that c++ cannot find the header file. For more information, please follow other related articles on the PHP Chinese website!