构建开源iOS应用时链接错误

时间:2018-09-05 13:12:55

标签: ios swift xcode open-source

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

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

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

添加了“尝试?”在给我一个“函数抛出但没有捕获”错误的函数之前

也许是一两个调整

在某些时候,我不得不编译以在iPhone上发送,通用或虚拟设备返回了更多错误,提示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 这是我要编译的代码,以防它有用

在此先感谢您的帮助

1 个答案:

答案 0 :(得分:1)

这是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

您需要做的是在-lstdc++中添加Other Linker Flags,该应用将正常运行!

enter image description here