2

I am working on a legacy project (iOS application) written in obj-c. The project links with a legacy static library written in obj-c.

The library was extended with a code written in Swift and builds without errors.

The problem is on the project level which builds with following errors:

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)
  • How to solve the problem?

Updated:

I am not using Cocoapods

Blazej SLEBODA
  • 8,936
  • 7
  • 53
  • 93

1 Answers1

4

Here is a solution which worked for me:

Apparently for pure objective-c projects you will need to add this $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) to the library search paths of your target. This worked for me when I was including a library written in swift to a project in objective-c

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

Blazej SLEBODA
  • 8,936
  • 7
  • 53
  • 93