How vscode solves the problem that c++ cannot find the header file

王林
Release: 2020-01-10 13:31:27
Original
9044 people have browsed it

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

How vscode solves the problem that c++ cannot find the header file

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 }
Copy after login

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",           ... ],
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!