Visual Studio 2010 Professional: Cannot find file "new.h",

So, I just got Visual Studio 2010 Professional, I created a simple mfc application, added code and did not change any project settings. When I try to compile it, I got this code:

1>------ Build started: Project: cadmenu, Configuration: Release Win32 ------ 1>Build started 10/15/2013 3:44:26 PM. 1>InitializeBuildStatus: 1> Touching "Release\cadmenu.unsuccessfulbuild". 1>ClCompile: 1> stdafx.cpp 1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afx.h(54): fatal error C1083: Cannot open include file: 'new.h': No such file or directory 1> 1>Build FAILED. 1> 1>Time Elapsed 00:00:00.06 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== 

This also happens if I create a new mfc application and do not add any code. I searched the whole computer, no new.h.

I understand that this is because the new.h file is not included in the include directory, but that does not make any sense, because I just did a complete installation of a professional visual studio 2010. I tried to delete, delete all Visual Studio files, and then re-install install, but the problem persists. Can someone tell me what is happening and how can I fix it? Thank you very much!


I am using Windows 8 on a 64 bit machine. I tried googling this problem all day and no good result.

+6
source share
6 answers

I just installed VS2015 and had the same problem. It looks like new.h was used to work with the VC folder (for example, C: \ Program Files (x86) \ Microsoft Visual Studio 12.0 \ VC \ include) and now lives in the SDK folder (for example, C: \ Program Files (x86) \ Windows Kits \ 10 \ Include \ 10.0.10150.0 \ ucrt). If you include this in your list of included folders, it will compile at that point.

enter image description here

+6
source

Right-click on your project, then go to "Properties", go to "Configuration Properties", "VC ++ Directories" and to "Include Directories": $ (VCInstallDir) include ;. That is, if you have new.h in the specified directory, i.e. Your installDir \ include

+3
source

I had the same problem and solved it by uninstalling all Microsoft Visual C ++ Redistributable installations and after that restored the VS installation.

0
source

Try installing VS2010 SP1, it should help

0
source

Just this problem arose while trying to create using VS2017 Build Tools ...

I solved it by adding the "Windows Universal CRT SDK" package to the manual installation.

0
source

For me, this was because my solution had goals for building a project related to the Windows SDK 10.0.10240, but the Visual Studio 2017 installer, during a simple upgrade of Visual Studio, quickly removed the 10240 SDK, as well as the Windows 8.1 SDK, which also needed my solution .

I had to go to Invidual Components in the installer and manually reinstall the Windows SDK 10.0.10240 SDK and the Windows 8.1 SDK, and now I returned the files to 3 GB again.

Lesson learned: The Visual Studio 2017 installer can do much more than just upgrade if you let it โ€œupgradeโ€ to another minor version.

I can also recommend checking that the standard Windows Universal C (UCRT) environment is running, as it seems to be located in the ucrt .

0
source

Source: https://habr.com/ru/post/956019/


All Articles