V4 currently doesnt build correctly on Windows – cocos2d-x


If you follow steps as below:

  1. unzip cocos2d-x-4.0.zip somewhere
  2. cd into cocos2d-x
  3. run setup.py. log in/log out to establish the env variables.
  4. execute cocos new blah -l cpp -p com.blah.blah
  5. cd blahproj.win32
  6. cmake … -G “Visual Studio 16 2019” -AWin32
  7. open the solution in VS and build

The build fails with

2>—— Build started: Project: SYNC_RESOURCE-ae, Configuration: Debug Win32 ——
2>Copying resources for ae …
2> copying to C:/work/ae/proj.win32/bin/ae/Debug/Resources
2>‘PYTHON_COMMAND-NOTFOUND’ is not recognized as an internal or external command,
2>operable program or batch file.
2>C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(155,5): error MSB3073: The command “setlocal
2>C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(155,5): error MSB3073: “C:Program FilesCMakebincmake.exe” -E echo ” copying to C:/work/ae/proj.win32/bin/ae/Debug/Resources”
2>C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(155,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
2>C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(155,5): error MSB3073: PYTHON_COMMAND-NOTFOUND C:/work/ae/cocos2d/cmake/scripts/sync_folder.py -s C:/work/ae/Resources -d C:/work/ae/proj.win32/bin/ae/Debug/Resources
2>C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(155,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
2>C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(155,5): error MSB3073: :cmEnd
2>C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(155,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
2>C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(155,5): error MSB3073: :cmErrorLevel
2>C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(155,5): error MSB3073: exit /b %1
2>C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(155,5): error MSB3073: :cmDone
2>C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(155,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
2>C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(155,5): error MSB3073: :VCEnd” exited with code 9009.

you can get it to succeed by commenting out these two lines from SYNC_RESOURCE-blah/CMakeLists.txt:

cocos_get_resource_path(APP_RES_DIR ${APP_NAME})
cocos_copy_target_res(${APP_NAME} LINK_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER})

and just copying the resources yourself.

Also the above builds x86. Is there no canonical way to build to x64 right now?



Source link

More To Explore

Share on facebook
Share on twitter
Share on linkedin
Share on email