Visual Studio 2022: Cannot open include file: 'ctype.h'
I found a bug report which is related: https://developercommunity.visualstudio.com/t/windows-81-sdk-1/151682
Although Microsoft staff declined to accept it as a bug, it is happening for me as well. When I install only Windows 8.1 SDK, no project can be compiled with it. I even tried to create a new Windows API project in VS2022, the project was created, but failed to compile with the same error.
So I tried to install Windows 10 SDK (from VS2022 installed, but that is probably not important) and this added some missing files which now help to compile Windows 8.1 SDK projects. Problem seems to be solved, my old C++ code can now be compiled with Windows 8.1 SDK and both C++ build tools 2015 and 2022.
fatal error C1083: Cannot open include file: 'excpt.h' and 'ctype.h'
I see the Header file here:
C:\Program Files (x86)\Windows Kits\8.1\Include\km\crt\excpt.h
So add the path C:\Program Files (x86)\Windows Kits\8.1\Include\km\crt\
to the search for includes files in the project properties.
If you use the Win10 SDK (for Version 1511), it it located here:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\km\crt\excpt.h
Related Topics
Why Should I Initialize Member Variables in the Order They'Re Declared In
How to Add the Mingw Bin Directory to My System Path
When Is It Safe to Call This-> in Constructor and Destructor
C++, How to Call a Constructor Directly, Without New
Why Can't I Store References in a 'Std::Map' in C++
How to Initialize Static Members in the Header
What's the Point in Defaulting Functions in C++11
Increment Void Pointer by One Byte? by Two
Concatenating Strings Doesn't Work as Expected
Error for Hash Function of Pair of Ints
Iteration Through Std Containers in Openmp
Is There a C++11 Syntax File for Vim
Using a Static Library in Qt Creator
How to Implement Lock Free Map in C++
How to Find Longest Common Substring Using C++
How Does the C++ Compiler Know Which Implementation of a Virtual Function to Call
Writing Python Bindings for C++ Code That Use Opencv
How to Have Polymorphic Containers with Value Semantics in C++