After upgrade to macOS Big Sur 11.01 i get the following error:
clang: error: no such file or directory: '/usr/lib/libz.dylib' clang: error: no such file or directory: '/usr/lib/libiconv.dylib' Command Ld failed with a nonzero exit code
How to reproduce: make new cocos2d-x project using:
Open the generated xcode project (change bundle identifier) and build
Versions:
you can fix this issue like this.
Other Linker Flags
libz.dylib => -lz
libiconv.dylib => -liconv
good luck.
I changed the file: 'CocosConfigDepend.cmake' in cmake/modules/ of the cocos2d-x v4.0 library.
elseif(IOS)
# Locate system libraries on iOS
find_library(UIKIT_LIBRARY UIKit)
find_library(OPENGLES_LIBRARY OpenGLES)
find_library(CORE_MOTION_LIBRARY CoreMotion)
find_library(AVKIT_LIBRARY AVKit)
find_library(CORE_MEDIA_LIBRARY CoreMedia)
find_library(CORE_TEXT_LIBRARY CoreText)
find_library(SECURITY_LIBRARY Security)
find_library(CORE_GRAPHICS_LIBRARY CoreGraphics)
find_library(AV_FOUNDATION_LIBRARY AVFoundation)
find_library(WEBKIT_LIBRARY WebKit)
find_library(ZLIB z)
find_library(ICONVLIB iconv)
list(APPEND PLATFORM_SPECIFIC_LIBS
${UIKIT_LIBRARY}
${OPENGLES_LIBRARY}
${CORE_MOTION_LIBRARY}
${AVKIT_LIBRARY}
${CORE_MEDIA_LIBRARY}
${CORE_TEXT_LIBRARY}
${SECURITY_LIBRARY}
${CORE_GRAPHICS_LIBRARY}
${AV_FOUNDATION_LIBRARY}
${WEBKIT_LIBRARY}
${COCOS_APPLE_LIBS}
${ZLIB}
${ICONVLIB}
#"/usr/lib/libz.dylib"
#"/usr/lib/libiconv.dylib"
)
endif()
Added the ZLIB and ICONVLIB, and removed full path rows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With