处理 SDL 和 Paypal 配置 -ObjC 冲突的问题

2020-03-20  本文已影响0人  93b3d3ccb7e6

问题:

因为项目要集成 SDL 库,但是如果在 Other Linker Flags 中配置了 -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 的话 Paypal 又会报错:

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)

解决方法:

image.png

如果编译项目时提示找不到 xx.a,可以手动拖入 xx.a 文件到 Other Linker Flags 弹窗中,如下图:

image.png

最后项目编译成功,运行也没问题。

注意:每添加一个 xx.a 文件,就要在上一行添加 -force_load,如上图。

参考博客:https://www.cnblogs.com/ivanway/p/3956185.html

上一篇下一篇

猜你喜欢

热点阅读