Mac os Big Sur cocos2d-x v.4 build error

Cocos2d-x v.4 has error in Big Sur:
“clang: error: no such file or directory: ‘/usr/lib/libiconv.dylib’
Command Ld failed with a nonzero exit code”

It is looks like there is not hard link to libiconv.dylib in /usr/lib and should be replaced with libiconv.tbd. Nevertheless, the project still does not build, giving an error: "clang: error: unknown argument: ‘-no_adhoc_codesign’ ".

Also, i can not create new projects, “cmake … -GXcode” command fails with error: “CMake Error at CMakeLists.txt:30 (project):
No CMAKE_C_COMPILER could be found.”


I didn’t use cocos v4 yet, but I have Big Sur - the latest Mac OS.
If this is true, is a very important issue. @slackmoehrle, cocos team is working on a new version of cocos v4 for C++ ? I already read various issues using cocos v4…

I haven’t upgraded yet to Big Sur due to known black screening with MacBook Pros.

I’ll make sure the team is aware of this.

I’m still using Mac OS X Catalina, but ran into a similar issue a while back. Following the info here, I was able to get past this error, specifically by running this command in a console window:
sudo xcodebuild -license accept

It then detected the C and CXX compilers correctly. See if that helps in some way.

It was a first thing i did before posting here. It not helps. Apple did some significant changes to xcode and break compatibility :grimacing:

Having this same problem after updating xcode 11 to 12.2. I’m still using Catalina.
iOS project is generated fine, but mac isn’t working. I tried @R101’s suggestion but didn’t work.

edit: updating cmake to version 3.18.4 fixes these issues. Mac project was generated and built fine. Now onto ios…
edit2: I was having an issue previously with a script to upload symbols to crashlytics but after updating cmake it seems to be working too.

@bolin what version of cmake were you using before updating to 3.18.4

Previous version was 3.17.2

Thanks. I just realized I haven’t updated brew since cmake 3.17.0

I totally forgot about the CMake version, since I already updated to version 3.18.4 a while back, which is most likely the reason it’s all working.

I can confirm, cmake 3.18.4 fixes issue!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.