首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ld:警告:找不到自动链接库“swiftObjectiveC”

ld:警告:找不到自动链接库“swiftObjectiveC”
EN

Stack Overflow用户
提问于 2019-03-26 10:35:57
回答 1查看 8.6K关注 0票数 2

我正在从事一个用obj-c编写的遗留项目(iOS应用程序)。该项目与用obj-c编写的遗留静态库链接。

使用Swift编写的代码对库进行了扩展,生成时没有错误。

问题是在项目级别上,它生成了以下错误:

代码语言:javascript
复制
ld: warning: Could not find auto-linked library 'swiftObjectiveC'
ld: warning: Could not find auto-linked library 'swiftSwiftOnoneSupport'
ld: warning: Could not find auto-linked library 'swiftCoreAudio'
ld: warning: Could not find auto-linked library 'swiftCoreGraphics'
ld: warning: Could not find auto-linked library 'swiftCore'
ld: warning: Could not find auto-linked library 'swiftQuartzCore'
ld: warning: Could not find auto-linked library 'swiftDarwin'
ld: warning: Could not find auto-linked library 'swiftsimd'
ld: warning: Could not find auto-linked library 'swiftFoundation'
ld: warning: Could not find auto-linked library 'swiftAVFoundation'
ld: warning: Could not find auto-linked library 'swiftCoreMedia'
ld: warning: Could not find auto-linked library 'swiftDispatch'
ld: warning: Could not find auto-linked library 'swiftCoreFoundation'
Undefined symbols for architecture x86_64:
  "protocol descriptor for Swift.Hashable", referenced from:
      protocol conformance descriptor for __C.AVAudioSessionCategory : Swift.Hashable in __C_Synthesized in libFindParking.a(libFindParking.a-x86_64-master.o)
      generic protocol witness table for __C.AVAudioSessionCategory : Swift.Hashable in __C_Synthesized in libFindParking.a(libFindParking.a-x86_64-master.o)
      protocol conformance descriptor for __C.AVAudioSessionMode : Swift.Hashable in __C_Synthesized in libFindParking.a(libFindParking.a-x86_64-master.o)
      generic protocol witness table for __C.AVAudioSessionMode : Swift.Hashable in __C_Synthesized in libFindParking.a(libFindParking.a-x86_64-master.o)
  • 如何解决这个问题?

更新:

我不使用Cocoapods

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-03-26 12:35:43

这里有一个对我有用的解决方案:

显然,对于纯objective项目,您需要将这个$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)添加到目标的库搜索路径中。当我把一个库写成目标-c中的一个项目时,这个方法对我起了作用。

https://stackoverflow.com/a/53101587/1180728

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55355030

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档