React Native不配置Other Link Flag -ObjC,工程如何运行



  • 因为项目要集成SDL,如果配置了-ObjC,SDL就会报错:
    Undefined symbols for architecture arm64:
    "_SDL_main", referenced from:
    -[SDLUIKitDelegate postFinishLaunch] in libSDL2.a(SDL_uikitappdelegate.o)
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    而删除-ObjC,React Native就会报错:
    Undefined symbols for architecture arm64:
    "OBJC_CLASS$_RCTReconnectingWebSocket", referenced from:
    objc-class-ref in libReact.a(RCTPackagerConnection.o)
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    不知道哪位大佬能帮忙解决一下?
    多谢!



  • @coderkbReact Native不配置Other Link Flag -ObjC,工程如何运行 中说:

    referenced

    你是拿别人编译好的C库直接用的?我觉得应该拿源码编译。