cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

Support Windows SDK 10.0.19041.0 and above

Open kienhg96 opened this issue 1 month ago • 0 comments

Cocos Creator version

3.8.3

System information

Windows 11 - Windows SDK 10.0.19041.0 or above

Issue description

When compiling the addon for editor (EngineAddon) on Windows, the macro OPAQUE of wingdi.h overrides all the OPAQUE values of cocos/scene/raytracing/Description.h. This causes building errors.

Adding the follow "undef" macro will make compilation successful:

#ifdef OPAQUE
#undef OPAQUE
#endif

This still works for Windows SDK 10.0.19041.0. But, using SDK 10.0.22621.0 to build engine will cause the editor failed to start up.

Relevant error log output

engine\native\external\win64\include\sdl2\SDL_stdinc.h(614): message : see previous definition of 'M_PI'
engine\native\cocos/scene/raytracing/Description.h(132,5): error C2143: syntax error: missing '}' before 'constant'
engine\native\cocos/scene/raytracing/Description.h(132,5): error C2059: syntax error: 'constant'
engine\native\cocos/scene/raytracing/Description.h(135,1): error C2143: syntax error: missing ';' before '}'
engine\native\cocos/scene/raytracing/Description.h(138,34): error C3646: 'pbrMetallicRoughness': unknown override specifier
engine\native\cocos/scene/raytracing/Description.h(138,54): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
engine\native\cocos/scene/raytracing/Description.h(139,31): error C3646: 'normalTexture': unknown override specifier
engine\native\cocos/scene/raytracing/Description.h(139,44): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
engine\native\cocos/scene/raytracing/Description.h(140,34): error C3646: 'occlusionTexture': unknown override specifier
engine\native\cocos/scene/raytracing/Description.h(140,50): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
engine\native\cocos/scene/raytracing/Description.h(141,17): error C3646: 'emissiveTexture': unknown override specifier
engine\native\cocos/scene/raytracing/Description.h(141,32): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
engine\native\cocos/scene/raytracing/Description.h(144,15): error C3646: 'alphaMode': unknown override specifier
engine\native\cocos/scene/raytracing/Description.h(144,24): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
engine\native\cocos/scene/raytracing/Description.h(286,5): error C2143: syntax error: missing '}' before 'constant'
engine\native\cocos/scene/raytracing/Description.h(286,5): error C2059: syntax error: 'constant'
engine\native\cocos/scene/raytracing/Description.h(288,1): error C2143: syntax error: missing ';' before '}'
engine\native\cocos/scene/raytracing/Description.h(301,37): error C3646: 'geometryDesc': unknown override specifier
engine\native\cocos/scene/raytracing/Description.h(301,49): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
engine\native\cocos/scene/raytracing/Description.h(302,29): error C3646: 'flags': unknown override specifier
engine\native\cocos/scene/raytracing/Description.h(302,35): error C2059: syntax error: '='

Steps to reproduce

  • Enviroment: Windows 10, SDK 10.0.19041.0 or above
  • Just get the cocos-engine from repo
  • Build the engine & generate simulator
  • Update engine path to editor
  • Enable "Use native engine for scene editor"

The editor will be failed to build native engine.

Minimal reproduction project

No response

kienhg96 avatar Jun 05 '24 07:06 kienhg96