For example, include Windows.h before ntddkbd.h.
Including WDK issue on Visual Studio
Hi
I have an MFC project and I want to use ntddkbd.h header file, but when including it get following errors: How solve it?!
I added this path to VC include dir: "C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared"
Visual Studio is 2022 ver 17.0 and installed WDK is for Win 11 (All of them are installed on a Virtual Machine on Windows 7)
Errored source line is _VARIANT_BOOL bool;
error C2144: syntax error: 'bool' should be preceded by ';'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\oaidl.h(445): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\oaidl.h(445): error C2208: 'bool': no members defined using this type
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\oaidl.h(460): error C2143: syntax error: missing ';' before '*'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\oaidl.h(460): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\oaidl.h(460): error C2238: unexpected token(s) preceding ';'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\propidl.h(319): error C2144: syntax error: 'bool' should be preceded by ';'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\propidl.h(319): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\propidl.h(319): error C2208: 'bool': no members defined using this type