私はobj-cで書かれたレガシープロジェクト(iOSアプリケーション)に取り組んでいます。プロジェクトは、obj-cで記述されたレガシー静的ライブラリとリンクしています。
ライブラリはSwiftで記述されたコードで拡張され、エラーなしでビルドされます。
問題は、次のエラーでビルドされるプロジェクトレベルにあります。
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を使用していません
これが私のために働いた解決策です:
どうやら純粋なObjective-cプロジェクトの場合、この$(TOOLCHAIN_DIR)/ usr / lib / swift / $(PLATFORM_NAME)をターゲットのライブラリ検索パスに追加する必要があります。これは、Objective-cのプロジェクトに迅速に記述されたライブラリを含めていたときにうまくいきました
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加