Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution of not being able to read the header File when vscode compiles and runs C++ Program

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you the solution that the header file can not be read when vscode compiles and runs C++ program. I hope you will get something after reading this article. Let's discuss it together.

Prerequisite: install vs code and MinGW, and configure the environment variables of MinGW.

Solution:

1. Open the C++ configuration file of vs code

Use the shortcut key ctrl+shift+p to open the search bar and enter C++

Open the icon configuration file

Add the header file in the include folder under the MinGW directory, such as: "Claxople MinGWAGWAGWPUBG *"

Then add the folder name at the end of the previous picture to the C++ configuration file

It should be noted that the copied file directory has forward slashes and backslashes. You need to change all\ backslashes to forward slashes, such as c:\ mingw\ bin\.. / lib/gcc/mingw32/4.6.2/include/c++.

Change to

CJV Universe MingwAccord... LIbUnix GCC Plus Mingw32 Universe 4.6.2According to

All file directories are double quotes with English punctuation at both ends. If not, an error may be reported.

After you add it, it looks like this:

Remember to save after the change, and type # include stdio.h at this time so that you won't make a mistake.

After reading this article, I believe you have a certain understanding of the "vscode compilation and running C++ program can not read the header file solution", if you want to know more related knowledge, welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report