c++ C2061语法错误:标识符'LPWNDCLASSEXA'

xu3bshqb  于 2023-03-05  发布在  其他
关注(0)|答案(2)|浏览(312)
  • 我在犯错 *
  • C2061语法错误:文件**c:\程序文件(x86)\Windows工具包\10\包含\10.0.19041.0\um\WinUser. h * 中的标识符“LPWNDCLASSEXA”

我正在将VS-2012代码移植到VS-2019。代码在VS-2012上编译良好。当我在VS-2019中打开解决方案文件时,它提供了升级Windows SDK工具包和平台工具链x1c 0d1x的选项。我选择升级。但现在编译失败。还有其他错误,在我通过Visual Studio安装程序安装142个构建工具后得到修复。
现在,我已低于错误

> C2061 syntax error: identifier 'LPWNDCLASSEXA' in file
> c:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\WinUser.h

I also tried to get include hierarchy which is as:

Rebuild started...
1>------ Rebuild All started: Project: handler-messages, Configuration: Debug Win32 ------
1>cl : command line warning D9035: option 'Gm' has been deprecated and will be removed in a future release
1>dllmain.cpp
1>Note: including file: C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\windows.h
1>Note: including file:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\winapifamily.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\winpackagefamily.h
1>Note: including file:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\sdkddkver.h
1>Note: including file:  C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\excpt.h
1>Note: including file:   C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\vcruntime.h
1>Note: including file:    C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\sal.h
1>Note: including file:     C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\concurrencysal.h
1>Note: including file:    C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\vadefs.h
1>Note: including file:  C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\stdarg.h
1>Note: including file:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\windef.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h
1>Note: including file:    C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\specstrings.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\specstrings_strict.h
1>Note: including file:      C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\specstrings_undef.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\driverspecs.h
1>Note: including file:      C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\sdv_driverspecs.h
1>Note: including file:    C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\ctype.h
1>Note: including file:      C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt.h
1>Note: including file:      C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_wctype.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\kernelspecs.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\basetsd.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\guiddef.h
1>Note: including file:      C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\string.h
1>Note: including file:       C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_memory.h
1>Note: including file:        C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_memcpy_s.h
1>Note: including file:         C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\errno.h
1>Note: including file:         C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\vcruntime_string.h
1>Note: including file:       C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_wstring.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack4.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack4.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack4.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack4.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack2.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack2.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack2.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack8.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack1.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack1.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\apiset.h
1>Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\ktmtypes.h
1>Note: including file:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winbase.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\apisetcconv.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\minwinbase.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\apiquery2.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\processenv.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\fileapifromapp.h
1>Note: including file:    C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\fileapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\debugapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\utilapiset.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\handleapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\errhandlingapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\fibersapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\namedpipeapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\profileapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\heapapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\ioapiset.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\synchapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\interlockedapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\processthreadsapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\sysinfoapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\memoryapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\enclaveapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\threadpoollegacyapiset.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\threadpoolapiset.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\jobapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\jobapi2.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\wow64apiset.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\libloaderapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\securitybaseapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\namespaceapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\systemtopologyapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\processtopologyapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\securityappcontainer.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\realtimeapiset.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\winerror.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\timezoneapi.h
1>Note: including file:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\wingdi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack1.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack2.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack2.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack4.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack4.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winuser.h
**1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winuser.h(4380,11): error C2061: syntax error: identifier 'LPWNDCLASSEXA'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winuser.h(4388,11): error C2061: syntax error: identifier 'LPWNDCLASSEXW'**
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\pshpack2.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\poppack.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\tvout.h
1>Note: including file:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnls.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\datetimeapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\stringapiset.h
1>Note: including file:    C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnls.h
1>Note: including file:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\wincon.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\wincontypes.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\consoleapi.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\consoleapi2.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\consoleapi3.h
1>Note: including file:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winver.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\verrsrc.h
1>Note: including file:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winreg.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\reason.h
1>Note: including file:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnetwk.h
1>Note: including file:   C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\wnnc.h
1>Note: including file:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\stralign.h
1>Note: including file:  C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winsvc.h
1>Done building project "handler-messages.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
kx7yvsdv

kx7yvsdv1#

我建议您在移植项目时参考document
使用LPWNDCLASSEXA需要添加#include<Windows.h>,尝试添加它并运行代码。

uhry853o

uhry853o2#

我必须将Windows SDK版本从10.0.19041.0降级到10.0.17763.0
这可能看起来很奇怪,但根据我的调查,WinUser.h的#if和#endif指令不匹配。我可能是错的,没有深入调查。

相关问题