Cocos2d-x 4.0 prebuilt libs linker fail

so in my quest to get the ios version working. I’ve now run into - clang: error: no such file or directory ‘(path to app)/cocos2d/external/Box2D/prebuilt/ios/libbox2d.a’ and chipmunk, freetype2, bullet, jpeg, webp etc etc

Which it didn’t have. So I found them in the full download of the cocos4 source code and I’ve added the ios folder to a couple of them and added the .a file, but it still fails to find them. Which makes me think the a files are not compatible, different compiler version, ABI maybe?

I’ve found references to cocos gen-libs but my 4.0 cocos doesn’t seem to support that command any more.

any ideas?

Did you run download_deps.py?

@oziphantom v4 doesn’t have a built-in function for prebuilt libraries anymore. Mostly due to Android issues.

You can always do this yourself using cmake. You could refer to old v3 builds to see what Gen-libs does and what files it includes.

You shouldn’t be adding the .a files manually to the Xcode project, if that’s what you’re doing. Also, gen-libs isn’t related to the external prebuilt libraries, which as @bolin already pointed out, you should have run python download_deps.py inside the root cocos folder:

Once you do that, you’ll have all the relevant external libraries downloaded and extracted automatically into the /external/ folder:

image

and if you go into Box2D, you’ll see that it does have the correct library files for each supported platform:
image
image

So, if you generated your project prior to running download_deps.py, then your project will have an empty ‘cocos2d/external/’ folder, and that is most likely the issue.

To fix this, simply copy over the contents of the external folder to [project path]/cocos2d/external/ from wherever you have the Cocos2d source code (after you run download_deps.py). Alternatively, create a new project using the cocos new command (like cocos new gamename -p com.example.gamename -l cpp -d .), and that should work since it has the external libraries.

Remember, do not manually add the .a files from the cocos2d/external/ folder to your Xcode, since that should be taken care of in the relevant CMakeLists.txt within the Cocos2d-x source.

Oh did he mean dependency prebuilt libraries or cocos2d-X as a prebuilt library?

I guess they did reference gen-libs but also bos2d.

I’m assuming it’s to do with the 3rd party libraries, since the OP refers to them as causing the problem:

…but then the remark about gen-libs confused things. If I recall correctly, gen-libs didn’t actually do anything to the 3rd party external folder, since many of those libraries are already prebuilt.

Correct thinking.

so I’ve rund download deps and copied the folder over. But I’m not sure if that fixes it because now, xcode “cancels the build”. It then thinks it has to be iphonesimulator only, forgets the bundle id, the provision profile and the team I have set and just doesn’t want to tell me why. Even if I do build for iphoneSimulator it still cancels the build. Nobody on Google seems to have experienced this.

I really want to avoid having a separate set of code for iOS again but it seems I’m just going to have to NFO and rebuild the whole thing again for iOS in its own project. And see if that works any better.

Having never used Gen-Libs I had no idea what it did, other than generate libs, which was what I needed. When you good missing libs cocos2d-x you get a bunch of SO posts and others saying “run gen-libs”

Xcode is terrible when it comes to IDEs, and the fact that it cancels a build without any errors is one of the most irritating things about it. Just make sure you do a clean before you do a build, especially when you change any CMakeLists.txt options.

Now, how exactly have you set the bundle, provision profile and team values? They should all be set in the CMakeLists.txt. If they were entered into Xcode manually after the project is loaded, then that would be the cause of the problem.

You shouldn’t need to do that. It’s all about the CMakeLists.txt file. In your CMakeLists.txt, towards the end, there is a section for Apple builds. Here’s mine from a project that works on all platforms (Windows, Android and iOS):

if(APPLE)
    set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")

    if(MACOSX)
        set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist")
    elseif(IOS)
        set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/ios/Info.plist")
        set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon")
        set_xcode_property(${APP_NAME} XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2") # iphone, ipad

        # force x86_64 architecture for iphonesimulator builds
        set_target_properties(${APP_NAME} PROPERTIES
            XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] x86_64
            XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] x86_64
            )
    endif()

    # For code-signing, set the DEVELOPMENT_TEAM:
    #set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "ABCXXXX123") # requires 10 digit identifier
    #set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer")
    
    if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET)
        #SET (CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 11.0)
    endif()
    SET (CMAKE_XCODE_ATTRIBUTE_PRODUCT_NAME "MyProjectName")
    #SET (CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER “my.bundle.identifier”)
    SET (CMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY 1,2) # not sure if this is required given it's been set above via set_xcode_property(...)
    #SET (CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH OFF)
    
    # any required framework libraries can be added here
    #target_link_libraries(${APP_NAME} PRIVATE "-framework MediaPlayer")

elseif(WINDOWS)
    cocos_copy_target_dll(${APP_NAME})
endif()
1 Like

that looks as if it would explain how things get iOSsimulator set as the target. Only not a single 1 of my cmakelists.txt had it defined. I searched every one.

After going in circles, I have
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE “${APP_UI_RES}”)

    if(MACOSX)
        set_xcode_property(${APP_NAME} INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist")
    elseif(IOS)
        set_xcode_property(${APP_NAME} INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/ios/Info.plist")
        set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon")

	# force x86_64 architecture for iphonesimulator builds
        set_target_properties(${APP_NAME} PROPERTIES
            XCODE_ATTRIBUTE_ARCHS[sdk=ios] $(ARCHS_STANDARD)
            XCODE_ATTRIBUTE_VALID_ARCHS[sdk=ios*] $(ARCHS_STANDARD)
	    set_xcode_property(${APP_NAME} BASE_SDK "iOS")
            )
    endif()

    # For code-signing, set the DEVELOPMENT_TEAM:
    #set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "Apple Development")
    set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Development")
    set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "<redacted>")
    #set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER "com.symbolicone.ouille")
    SET (CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.symbolicone.ouille")
    #set_xcode_property(${APP_NAME} PROVISIONING_PROFILE "oullieDev")
    set_xcode_property(${APP_NAME} PROVISIONING_PROFILE "Automatic")
elseif(WINDOWS)
    cocos_copy_target_dll(${APP_NAME})
endif()

Which still doesn’t work. It still cancels and gets iosSimulator ( is this some default value built into CMAKE? some odd fails case of Xcode (I’m on 11.4)) if I set some of the properties, it will complain I don’t have a bundle ID, or a provisioning profile and as I try to set them, it just go back to the other. I tried switching to manual provisioning, only then it doesn’t like the certificate any more. I try and go back to automatic and then it fails the old ways again.

Is there not a way to tell CMAKE to not modify a single value and let Xcode set the values?

Well, every time CMake runs it recreates your XCode project, so the only way to prevent your XCode settings being deleted is to not run CMake, but that defeats the purpose of using CMake.

You should check the CMake log files, which should contain the relevant fields and whatever values they are set to. Double check to see if they’re actually set to what you have in the CMakeLists.txt.

If it still messes up, delete the entire build folder, recreate it, and run cmake again, just to see if that helps. Also, if you change option settings in CMakeLists.txt, it sometimes doesn’t work, and you need to delete the /[buildfolder]/CMakeCache.txt file before running cmake again to update the XCode project.

so for the sake of experimenting, I made an all new new stock cocos app for testing. One that is pure neat and doesn’t have any pods or spine or anything else.

turns out “run” is suppose to make it “run” on the simulator and doesn’t handle hardware at all.
I found in some posts you need to set -sdk iphoneos and do a command line compile. Which adds the extra stuff your post had to the cmakefiles.txt which is not enough alone
set_xcode_property(${APP_NAME} PRODUCT_BUNDLE_IDENTIFIER “your app id here”) is also needed.
After I use Xcode to set up and make a provision profile etc I then get it to this point
Check dependencies

Code Signing Error: No profiles for ‘org.oziphantom.TestiOS2’ were found: Xcode couldn’t find any iOS App Development provisioning profiles matching ‘org.oziphantom.TestiOS2’. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.

Code Signing Error: Code signing is required for product type ‘Application’ in SDK ‘iOS 13.4’

**** BUILD FAILED ****

how do we get -allowProvisioningUpdates added to the Xcodebuild command line?

I think I’ve been able to get it past the “no credentials stage” and I have it build with a deploy but it just won’t let the simulator go.
If I do a deploy -sdk iphoneos it doesn’t actually upload anything to the iPad. If I do a deploy without -sdk iphoneos after a compile with it, it still uploads the simulator. It can’t run something on the simulator though it just exits.

If I build in Xcode I get
Ld ios-build/bin/TestIOS/Debug/TestIOS.app/TestIOS normal arm64
cd /Users/macbook/Documents/GitHub/testiOS/TestIOS
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target arm64-apple-ios8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.4.sdk -L/Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/bin/TestIOS/Debug -F/Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/bin/TestIOS/Debug -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -filelist /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/TestIOS.build/Debug-iphoneos/TestIOS.build/Objects-normal/arm64/TestIOS.LinkFileList -dead_strip -Xlinker -object_path_lto -Xlinker /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/TestIOS.build/Debug-iphoneos/TestIOS.build/Objects-normal/arm64/TestIOS_lto.o -Xlinker -no_deduplicate -fobjc-link-runtime -Wl,-headerpad_max_install_names /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/lib/Debug/libcocos2d.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/lib/Debug/libexternal.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/Box2D/prebuilt/ios/libbox2d.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/chipmunk/prebuilt/ios/libchipmunk.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/freetype2/prebuilt/ios/libfreetype.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/lib/Debug/libext_recast.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/bullet/prebuilt/ios/libLinearMath.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/bullet/prebuilt/ios/libBulletDynamics.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/bullet/prebuilt/ios/libBulletCollision.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/bullet/prebuilt/ios/libLinearMath.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/bullet/prebuilt/ios/libBulletMultiThreaded.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/bullet/prebuilt/ios/libMiniCL.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/jpeg/prebuilt/ios/libjpeg.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/webp/prebuilt/ios/libwebp.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/websockets/prebuilt/ios/libwebsockets.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/openssl/prebuilt/ios/libssl.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/openssl/prebuilt/ios/libcrypto.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/uv/prebuilt/ios/libuv_a.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/lib/Debug/libext_tinyxml2.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/lib/Debug/libext_xxhash.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/lib/Debug/libext_xxtea.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/lib/Debug/libext_clipper.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/lib/Debug/libext_edtaa3func.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/lib/Debug/libext_convertUTF.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/lib/Debug/libext_poly2tri.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/lib/Debug/libext_md5.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/curl/prebuilt/ios/libcurl.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/png/prebuilt/ios/libpng.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/lib/Debug/libext_unzip.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/glsl-optimizer/prebuilt/ios/libglcpp-library.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/glsl-optimizer/prebuilt/ios/libglsl_optimizer.a /Users/macbook/Documents/GitHub/testiOS/TestIOS/cocos2d/external/glsl-optimizer/prebuilt/ios/libmesa.a -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework UIKit -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework OpenGLES -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework CoreMotion -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework AVKit -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework CoreMedia -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework CoreText -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework Security -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework CoreGraphics -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework AVFoundation -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework WebKit -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework OpenAL -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework AudioToolbox -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework QuartzCore -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework Foundation -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework GameController -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks -framework Metal /usr/lib/libz.dylib /usr/lib/libiconv.dylib -Xlinker -dependency_info -Xlinker /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/TestIOS.build/Debug-iphoneos/TestIOS.build/Objects-normal/arm64/TestIOS_dependency_info.dat -o /Users/macbook/Documents/GitHub/testiOS/TestIOS/ios-build/bin/TestIOS/Debug/TestIOS.app/TestIOS

ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/OpenGLES.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenGLES.framework/OpenGLES.tbd (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreMotion.framework/CoreMotion.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreMotion.framework/CoreMotion.tbd (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/AVKit.framework/AVKit.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/AVKit.framework/AVKit.tbd (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/CoreText.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreText.framework/CoreText.tbd (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Security.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Security.framework/Security.tbd (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreMedia.framework/CoreMedia.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreMedia.framework/CoreMedia.tbd (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics.tbd (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/UIKit.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/UIKit.tbd (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenAL.framework/OpenAL.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/OpenAL.framework/OpenAL.tbd (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/AVFoundation.framework/AVFoundation.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/AVFoundation.framework/AVFoundation.tbd (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox.tbd (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/WebKit.framework/WebKit.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/WebKit.framework/WebKit.tbd (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/GameController.framework/GameController.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/GameController.framework/GameController.tbd (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.tbd (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Metal.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Metal.framework/Metal.tbd (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Foundation.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/Foundation.framework/Foundation.tbd (2 slices)
ld: warning: Could not find or use auto-linked framework 'CoreFoundation'
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_NSMutableParagraphStyle", referenced from:
      objc-class-ref in libcocos2d.a(CCDevice-apple.o)
  "_OBJC_CLASS_$_MTLRenderPipelineDescriptor", referenced from:
      objc-class-ref in libcocos2d.a(RenderPipelineMTL.o)
  "_OBJC_CLASS_$_NSAutoreleasePool", referenced from:
      objc-class-ref in libcocos2d.a(CommandBufferMTL.o)
  "_NSLog", referenced from:

note the missing arm64 and iphonesimulator sdk are mentioned in some of the entries.

This isn’t correct unless you’re building on the new M1 Macs, because the architecture of the simulator builds will end up as ARM/ARM64.

On a x86 Mac, it needs to be set as I posted above:

        set_target_properties(${APP_NAME} PROPERTIES
            XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] x86_64
            XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] x86_64
            )

Now, since you’re not actually after a simulator build, how exactly are you building your app in Xcode? If you can take a screenshot of exactly what it is you’re clicking, then it may shed some light on why this is happening. Using MacOS 10.15.7 and Xcode 12.2, I’m getting absolutely no errors when building for a real device.

Command + B

Or selecting it from the Project menu.

I have the “name of app” selected in the targets drop down and I have it set to Generic iOS device. Or my actual iPad.

Check this post and see if that helps. Try the SET (CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH OFF) setting as well.

SET (CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH OFF) Got the Hello World building and running. I also deleted the cache file and rebuilt. Now to get the real app running.

okay for the main one I need to add something to the HEADER_SEARCH_PATHS doing a search for it doesn’t yield as results in a cmake file that I can see. I tried googling how to append to a property. I don’t want to overwrite it I want to concatenate it. I need to add ‘($inherited)’

no that is not enough. I need to it do a ‘pod install’ as well after it rebuilds the project file, but before it compiles.

Or is there a way to get CMake to make an Xcode project file and then you build with just Xcode and not CMake again, might be easier to just side step it?

If pod install modifies the Xcode file, it could be causing issues.

There was a very long thread on this forum about that, and if I recall correctly, the issue of pods and CMake was mentioned, so maybe there is a solution in that thread. I can’t find the link to it at the moment, so just use the search functionality of this forum to try and find it.