Search code examples
iosswiftxcodeopen-source

Linking error while building an open source iOS app


I am trying to compile an open source iOS app named Partita, the project seems dead for two years and it look like updates to some things broke a thing or two.

here's what I've done so far (I may have forgotten a step)

One of the dependency (audio kit) were compiled with an old swift version, so I took the newest source code and compiled a brand new framework and replaced the old that pod is giving me

added a "try?" before a function that gave me a "function throw but no catch" error

maybe a tweak or two

At some point I had to compile to send on my iPhone, generic or virtual device return more errors saying AudioKit is unavailable, cannot find declarations, ect. but its fine if i compile for a real device

Now I'm stuck with linking error, here they are

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)

The errors seems to come exclusively from AudioKit (the framework I had to recompile) so maybe thats where I have to change a setting or two for it to work, honestly I'm lost here! I just migrated to Mac ecosystem and I don't get much about the structure of projects and Xcode overall

https://github.com/comyar/Partita here's the code I'm trying to compile, in case its useful

Thanks in advance for any help


Solution

  • It's a problem with the AudioKit.framework.

    Download the latest release: https://github.com/AudioKit/AudioKit/releases

    And follow the instructions: https://github.com/audiokit/AudioKit/blob/master/Frameworks/README.md#using-the-compiled-frameworks-in-your-projects

    What you need to do is add -lstdc++ in the Other Linker Flags and the app will run without errors!

    enter image description here