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.16k stars 7.05k forks source link

Does not work on iMac M1 BigSur #20687

Open crookedbard opened 3 years ago

crookedbard commented 3 years ago

cocos run -p Mac:

"_png_write_image", referenced from: cocos2d::Image::saveImageToPNG(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, bool) in libcocos2d.a(CCImage.o) "_png_write_info", referenced from: cocos2d::Image::saveImageToPNG(std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, bool) in libcocos2d.a(CCImage.o)

ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

/Users/xxxx/source/repos/xxxx/xxxxxx/mac-build/xxxxx.xcodeproj: warning: The Copy Bundle Resources build phase contains this target's Info.plist file '/Users/xxx/source/repos/xxxx/xxxx/proj.ios_mac/mac/Info.plist'. (in target 'xxxxxx' from project 'xxxxxx') BUILD FAILED

Xcode throws over 100 errors of undefined symbols

slackmoehrle commented 3 years ago

We dont officially offer a build yet, but there is someone who says they have it working: https://discuss.cocos2d-x.org/t/cant-run-cocos2d-x-on-m1-chip/54427/

crookedbard commented 2 years ago

Any estimates on when you are planning on supporting latest macos version?

slackmoehrle commented 2 years ago

not at this time.

shengdoushi commented 2 years ago

not at this time. when cocos2d-x support m1 mac?

A-deLuna commented 1 year ago

If anyone comes across this issue, a quick way to get going is to use Rosetta2.

We'll build everything as x86_64 and let Rosetta2 translate instructions to arm on the fly.

First, remove the mac-build directory if you have one already. It's already configured to compile to arm.

Now run arch -x86_64 zsh. You can confirm it works if uname -m prints x86_64.

Now run cocos run as usual (make sure any previously created build dirs are removed). It should build correctly.