錯誤復現:
D:\Software\cocos2d-x\cocos\ui\UIEditBox\UIEditBoxImpl-win32.cpp(64,70): error C2065: 'GWL_WNDPROC': undeclared ide
ntifier [D:\Projects\CPP\CMake\cocos\Runner\fakebuild\engine\cocos\core\cocos2d.vcxproj]
D:\Software\cocos2d-x\cocos\ui\UIEditBox\UIEditBoxImpl-win32.cpp(101,42): error C2065: 'GWL_WNDPROC': undeclared id
entifier [D:\Projects\CPP\CMake\cocos\Runner\fakebuild\engine\cocos\core\cocos2d.vcxproj]
UIHBox.cpp
D:\Software\cocos2d-x\cocos\ui\UIEditBox\UIEditBoxImpl-win32.cpp(124,17): warning C4312: 'type cast': conversion fr
om 'int' to 'HMENU' of greater size [D:\Projects\CPP\CMake\cocos\Runner\fakebuild\engine\cocos\core\cocos2d.vcxproj
]
D:\Software\cocos2d-x\cocos\ui\UIEditBox\UIEditBoxImpl-win32.cpp(128,42): error C2065: 'GWL_USERDATA': undeclared i
dentifier [D:\Projects\CPP\CMake\cocos\Runner\fakebuild\engine\cocos\core\cocos2d.vcxproj]
D:\Software\cocos2d-x\cocos\ui\UIEditBox\UIEditBoxImpl-win32.cpp(129,66): error C2065: 'GWL_WNDPROC': undeclared id
entifier [D:\Projects\CPP\CMake\cocos\Runner\fakebuild\engine\cocos\core\cocos2d.vcxproj]
編譯過程:
cmake ..
cmake --build . --config Debug
解決方案:
指定生成的平臺win32 以及指定Visual Studio的版本
cmake .. -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Debug -A win32
引用自
貼出clion配置方案: