Can’t find .h files

Copper Contributor

I installed VS2022 in order to create some windows C++ applications. I selected the workloads relating to C++ and desktop applications but when I try and create an application and compile it it comes up with lots of the standard C++ files missing:

 

>In guiddef.h:   string.h

>In  winnt.h:   ctype.h, string.h 

>In framework.h:   malloc.h, memory.h, tchar.h

Cannot open include file: 'ctype.h': No such file or directory

 

I have been trying adding all manner of extras from the list but nothing I do works. I have even deleted the entire package and tried reinstalling it several times but with the same result. It tries to compile it but I get the same 8 or 9 missing files.

 

The error file:

Build started...
------ Build started: Project: WindowsProject1, Configuration: Debug Win32 ------
WindowsProject1.cpp
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winnt.h(34,10): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
Done building project "WindowsProject1.vcxproj" -- FAILED.
------ Build started: Project: WindowsProject1, Configuration: Release Win32 ------
WindowsProject1.cpp
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winnt.h(34,10): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
Done building project "WindowsProject1.vcxproj" -- FAILED.
------ Build started: Project: WindowsProject1, Configuration: Debug x64 ------
WindowsProject1.cpp
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winnt.h(34,10): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
Done building project "WindowsProject1.vcxproj" -- FAILED.
------ Build started: Project: WindowsProject1, Configuration: Release x64 ------
WindowsProject1.cpp
C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um\winnt.h(34,10): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
Done building project "WindowsProject1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 4 failed, 0 up-to-date, 0 skipped ==========


I have also installed the VS2022 package on an old laptop expecting the same result but it just worked first time!  Both machines are running W10 with VS2022 community version.

Any ideas! I’ve wasted two days trying to get this to work.

1 Reply

Hi @Cowasaki,

Thanks for posting your issue here.

However this platform is used for how-to discussions and sharing best practices for building any app with .NET.Since your issue is a technical question, welcome to post it in Microsoft Q&A forum, the support team and communities on Microsoft Q&A will help you for any technical questions.
Besides, it will be appreciated if you can share it here once you post this technical question Microsoft Q&A.

Best Regards,
Lan Huang