Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

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 app and do not add any code. I searched the entire computer, there is no new.h.

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


I'm using Windows 8 on a 64-bit machine. I tried Googling this problem all day and no good result.

like image 353
Tengyu Liu Avatar asked Oct 15 '13 20:10

Tengyu Liu


2 Answers

Just had this problem when trying to build with VS2017 Build Tools, too...

Solved it by adding the package "Windows Universal CRT SDK" to the install manually.

like image 196
JCH2k Avatar answered Sep 20 '22 19:09

JCH2k


For me, it was because my solution had project build targets referring to the Windows SDK 10.0.10240, but the Visual Studio 2017 installer had, during a mere upgrade of Visual Studio, promptly removed the 10240 SDK as well as the Windows 8.1 SDK which my solution also needed.

I had to go to Invidual Components in the installer and manually re-check the Windows SDK 10.0.10240 and Windows 8.1 SDK, and now I got 3 GB worth of files back again.

Lesson learnt: The Visual Studio 2017 installer can do much more than just upgrade, if you let it "upgrade" to another minor release.

I can also recommend verifying so that the Windows Universal C Runtime (UCRT) is checked since it seems to reside under the ucrt subfolder.

like image 42
Jonas Avatar answered Sep 20 '22 19:09

Jonas