Solutions to the prompts "Unable to open source file '***.h'" and "There is no '***' in the global scope" when the VS project is running

one,

I have been using C#, and I haven't run a C++ program for a long time. Recently, I was going to learn data structure based on C++, but when I ran it, there were more than 400 errors as follows:

After tossing for a long time according to the method on the Internet, I couldn't solve it. Finally, I found a very simple way to solve the problem.

two,

First of all, the cause of the problem should be clarified. It should be caused by the failure to find the SDK software toolkit supporting C++. It may be because the folder was changed privately, or it was deleted by mistake. So we need to reinstall and link the SDK package.

Directly speaking, my final solution is to reinstall an SDK package. (It is best to install a new version that is different from the current version, then the system will automatically complete all configurations for you)

First select Tools -> Get Tools and Features to open the workload installation interface.

The picture shows the original SDK package

Don't worry about him, just check and install the latest SDK package

 After the installation is complete, the program can run normally

three,

If not successful, you may need to manually modify the SDK version of the project. 

Right-click the project -> properties to view the current SDK version settings

Select 10.0 (latest installed version) and it works fine.

over!

Guess you like

Origin blog.csdn.net/Eason_Y/article/details/123530463