Open crookedbard opened 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/
Any estimates on when you are planning on supporting latest macos version?
not at this time.
not at this time. when cocos2d-x support m1 mac?
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.
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