Vis*_*ani 18 static-libraries ios swift swift4 xcode9.3
我需要为我的要求制作swift静态库.我制作了swift静态库,它使用swift和Obj-c代码.我通过桥文件包含了Obj-c文件.我能够编译swift静态库而不会出现任何错误,并获取libMySwift.a文件.我使用Xcode9.3和Swift4来编译库.
我在obj-c项目中包含了libMySwift.a,还包含了obj-c兼容的头文件来访问项目中的lib.当我尝试编译项目时,它会给出以下警告和200多个错误.
Auto-Linking library not found for -lswiftSwiftOnoneSupport
Auto-Linking library not found for -lswiftCore
Auto-Linking library not found for -lswiftQuartzCore
Auto-Linking library not found for -lswiftCoreImage
Auto-Linking library not found for -lswiftCoreGraphics
Auto-Linking library not found for -lswiftObjectiveC
Auto-Linking library not found for -lswiftDispatch
Auto-Linking library not found for -lswiftMetal
Auto-Linking library not found for -lswiftFoundation
Auto-Linking library not found for -lswiftUIKit
Auto-Linking library not found for -lswiftDarwin
Auto-Linking library not found for -lswiftCoreFoundation
Run Code Online (Sandbox Code Playgroud)
如果我遗漏任何步骤或需要添加任何内容,请告诉我.
小智 56
当我的pod中添加第一个Swift文件作为静态库编译时,我在我的演示项目中遇到了同样的错误.对我来说,解决方案很简单 - 只需将空的Swift文件添加到我之前只在Objective-C中的演示项目中.这解决了所有链接器错误.
小智 16
亚历克斯答案的更新:
就我而言,这是在添加Swift Pods库之后的一个React-Native项目。也许只是步骤2可以工作:
| 归档时间: |
|
| 查看次数: |
6912 次 |
| 最近记录: |