构建开源 iOS 应用程序时出现链接错误

Linking error while building an open source iOS app

我正在尝试编译一个名为 Partita 的开源 iOS 应用程序,该项目似乎已经死了两年,看起来某些东西的更新破坏了一两件事。

这是我到目前为止所做的(我可能忘记了一步)

其中一个依赖项(音频工具包)是用旧 swift 版本编译的,所以我采用了最新的源代码并编译了一个全新的框架并替换了 pod 给我的旧框架

在给我一个 "function throw but no catch" 错误的函数前添加了一个 "try?"

也许一两个调整

在某些时候,我不得不编译以在我的 iPhone、通用或虚拟设备 return 上发送更多错误,说 AudioKit 不可用、找不到声明等。但如果我为真实设备编译就没问题

现在我被链接错误困住了,他们在这里

Ld /Users/pierrick/Library/Developer/Xcode/DerivedData/Partita-doeawmfadbgytvfskorsvxjyuroj/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/TuningFork.build/Objects-normal/arm64/TuningFork normal arm64
    cd "/Users/pierrick/Documents/Documents - MacBook Pro de Pierrick/Programming/Partita/Pods"
    export IPHONEOS_DEPLOYMENT_TARGET=9.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk -L/Users/pierrick/Library/Developer/Xcode/DerivedData/Partita-doeawmfadbgytvfskorsvxjyuroj/Build/Products/Debug-iphoneos/TuningFork -F/Users/pierrick/Library/Developer/Xcode/DerivedData/Partita-doeawmfadbgytvfskorsvxjyuroj/Build/Products/Debug-iphoneos/TuningFork -F/Users/pierrick/Library/Developer/Xcode/DerivedData/Partita-doeawmfadbgytvfskorsvxjyuroj/Build/Products/Debug-iphoneos/Chronos-Swift -F/Users/pierrick/Documents/Documents\ -\ MacBook\ Pro\ de\ Pierrick/Programming/Partita/Pods/AudioKit/iOS -filelist /Users/pierrick/Library/Developer/Xcode/DerivedData/Partita-doeawmfadbgytvfskorsvxjyuroj/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/TuningFork.build/Objects-normal/arm64/TuningFork.LinkFileList -install_name @rpath/TuningFork.framework/TuningFork -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -miphoneos-version-min=9.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/pierrick/Library/Developer/Xcode/DerivedData/Partita-doeawmfadbgytvfskorsvxjyuroj/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/TuningFork.build/Objects-normal/arm64/TuningFork_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/pierrick/Library/Developer/Xcode/DerivedData/Partita-doeawmfadbgytvfskorsvxjyuroj/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/TuningFork.build/Objects-normal/arm64/TuningFork.swiftmodule -framework AVFoundation -framework AudioKit -framework Chronos -framework AudioKit -framework Chronos -framework Foundation -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/pierrick/Library/Developer/Xcode/DerivedData/Partita-doeawmfadbgytvfskorsvxjyuroj/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/TuningFork.build/Objects-normal/arm64/TuningFork_dependency_info.dat -o /Users/pierrick/Library/Developer/Xcode/DerivedData/Partita-doeawmfadbgytvfskorsvxjyuroj/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/TuningFork.build/Objects-normal/arm64/TuningFork

Undefined symbols for architecture arm64:
  "std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
      -[AKOperationGeneratorAudioUnit addCustomUgen:] in AudioKit(AKOperationGeneratorAudioUnit.o)
  "operator new(unsigned long)", referenced from:
      _createBoosterDSP in AudioKit(AKBooster-7854F601498F0658.o)
      -[AKOperationGeneratorAudioUnit addCustomUgen:] in AudioKit(AKOperationGeneratorAudioUnit.o)
  "vtable for __cxxabiv1::__vmi_class_type_info", referenced from:
      typeinfo for AKFrequencyTrackerDSPKernel in AudioKit(AKFrequencyTrackerAudioUnit.o)
      typeinfo for AKTesterDSPKernel in AudioKit(AKTesterAudioUnit.o)
      typeinfo for AKOperationGeneratorDSPKernel in AudioKit(AKOperationGeneratorAudioUnit.o)
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "vtable for __cxxabiv1::__class_type_info", referenced from:
      typeinfo for DSPKernel in AudioKit(AKFrequencyTrackerAudioUnit.o)
      typeinfo for AKOutputBuffered in AudioKit(AKFrequencyTrackerAudioUnit.o)
      typeinfo for AKDSPBase in AudioKit(AKBooster-7854F601498F0658.o)
      typeinfo for AKParameterRampBase in AudioKit(AKBooster-7854F601498F0658.o)
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "___cxa_begin_catch", referenced from:
      ___clang_call_terminate in AudioKit(AKFrequencyTrackerAudioUnit.o)
  "vtable for __cxxabiv1::__si_class_type_info", referenced from:
      typeinfo for AKDSPKernel in AudioKit(AKFrequencyTrackerAudioUnit.o)
      typeinfo for AKSoundpipeKernel in AudioKit(AKFrequencyTrackerAudioUnit.o)
      typeinfo for AKBuffered in AudioKit(AKFrequencyTrackerAudioUnit.o)
      typeinfo for AKBoosterDSP in AudioKit(AKBooster-7854F601498F0658.o)
      typeinfo for AKExponentialParameterRamp in AudioKit(AKBooster-7854F601498F0658.o)
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "___cxa_pure_virtual", referenced from:
      vtable for AKSoundpipeKernel in AudioKit(AKFrequencyTrackerAudioUnit.o)
      vtable for AKDSPKernel in AudioKit(AKDSPKernel.o)
      vtable for AKSoundpipeKernel in AudioKit(AKOperationGeneratorAudioUnit.o)
  "operator delete(void*)", referenced from:
      AKFrequencyTrackerDSPKernel::~AKFrequencyTrackerDSPKernel() in AudioKit(AKFrequencyTrackerAudioUnit.o)
      AKTesterDSPKernel::~AKTesterDSPKernel() in AudioKit(AKTesterAudioUnit.o)
      -[AKOperationGeneratorAudioUnit addCustomUgen:] in AudioKit(AKOperationGeneratorAudioUnit.o)
      -[AKOperationGeneratorAudioUnit .cxx_destruct] in AudioKit(AKOperationGeneratorAudioUnit.o)
      AKOperationGeneratorDSPKernel::~AKOperationGeneratorDSPKernel() in AudioKit(AKOperationGeneratorAudioUnit.o)
      AKOperationGeneratorDSPKernel::~AKOperationGeneratorDSPKernel() in AudioKit(AKOperationGeneratorAudioUnit.o)
  "std::terminate()", referenced from:
      ___clang_call_terminate in AudioKit(AKFrequencyTrackerAudioUnit.o)
  "___gxx_personality_v0", referenced from:
      -[AKFrequencyTrackerAudioUnit createParameters] in AudioKit(AKFrequencyTrackerAudioUnit.o)
      BufferedAudioBus::init(AVAudioFormat*, unsigned int) in AudioKit(AKFrequencyTrackerAudioUnit.o)
      -[AKFrequencyTrackerAudioUnit allocateRenderResourcesAndReturnError:] in AudioKit(AKFrequencyTrackerAudioUnit.o)
      BufferedAudioBus::allocateRenderResources(unsigned int) in AudioKit(AKFrequencyTrackerAudioUnit.o)
      ___50-[AKFrequencyTrackerAudioUnit internalRenderBlock]_block_invoke in AudioKit(AKFrequencyTrackerAudioUnit.o)
      -[AKFrequencyTrackerAudioUnit .cxx_destruct] in AudioKit(AKFrequencyTrackerAudioUnit.o)
      AKFrequencyTrackerDSPKernel::~AKFrequencyTrackerDSPKernel() in AudioKit(AKFrequencyTrackerAudioUnit.o)
      ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

错误似乎完全来自 AudioKit(我必须重新编译的框架)所以也许这就是我必须更改一两个设置才能使其工作的地方,老实说我在这里迷路了!我刚刚迁移到 Mac 生态系统,我不太了解项目结构和 Xcode 整体

https://github.com/comyar/Partita 这是我正在尝试编译的代码,以防它有用

在此先感谢您的帮助

AudioKit.framework 有问题。

下载最新版本:https://github.com/AudioKit/AudioKit/releases

并按照说明进行操作:https://github.com/audiokit/AudioKit/blob/master/Frameworks/README.md#using-the-compiled-frameworks-in-your-projects

您需要做的是在 Other Linker Flags 中添加 -lstdc++ 然后应用程序将 运行 没有错误!