cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.02k stars 7.05k forks source link

recreating sln files for windows #20731

Open eaglclaws opened 2 years ago

eaglclaws commented 2 years ago

It appears when one makes a new project using cocos new on mac or linux the sln files for win32 are omitted, resulting in the project unfit for building on windows. Is there a way to recreate the sln without making a new project on windows and copying the files?

rh101 commented 2 years ago

Which version of cocos2d-x are you using?

If it's v3.17+ or v4, then to save yourself a lot of trouble, you should be using cmake for everything. When you use cmake, you only generate the build folder (with the Visual Studio solution files) only when you need to, and you don't commit them to your source control either. This way you don't need to copy the project build files across, you just generate them when you need them.

eaglclaws commented 2 years ago

v4, And just as you said, after using cmake for compiling, everything turned out fine. Thank you.

For anyone who finds this thread in the future: Assuming you are using MSVC2019

cd win-build cmake .. -A win32 cmake --build . --config Release

is what I did to compile. -A win32 is crucial because for some reason cocos does not play well with 64bit systems as of writing this. Probably will become obsolete in the future.

rh101 commented 2 years ago

is what I did to compile. -A win32 is crucial because for some reason cocos does not play well with 64bit systems as of writing this. Probably will become obsolete in the future.

@eaglclaws Cocos2d-x doesn't have 64-bit support for Windows. If you need that, then check out this fork of Cocos2d-x v4, which had 64 bit support added quite a while back.

eaglclaws commented 2 years ago

Cool, thanks for clarifying.