alexbw / novocaine

Painless high-performance audio on iOS and Mac OS X
http://alexbw.github.com/novocaine/
MIT License
2.23k stars 274 forks source link

How do I set up an ios project to use novocaine via cocoapods? #109

Closed rodrigoelp closed 8 years ago

rodrigoelp commented 9 years ago

Hey guys, I have been trying to understand how to use novocaine in my project and is biting a bing chunk of my will to include it at all.

Here is the list of steps I have done to use this library:

  1. Create a single view application.
  2. In my terminal typed cd /path/to/xcproj $ pod init This creates my Podfile.
  3. Edit the podfile to include pod 'novocaine'
  4. On my terminal $ pod install then open novocaineSample.xcworkspace
  5. Added Audiotoolkit and CoreAudio to the linker (Target > Build Phases).
  6. Try to build. Failing with the following errors:
Undefined symbols for architecture x86_64:
  "operator delete(void*)", referenced from:
      -[AudioFileReader dealloc] in libPods-novocaine-Novocaine.a(AudioFileReader.o)
      -[AudioFileReader initWithAudioFileURL:samplingRate:numChannels:] in libPods-novocaine-Novocaine.a(AudioFileReader.o)
  "operator new(unsigned long)", referenced from:
      -[AudioFileReader initWithAudioFileURL:samplingRate:numChannels:] in libPods-novocaine-Novocaine.a(AudioFileReader.o)
  "___gxx_personality_v0", referenced from:
      Dwarf Exception Unwind Info (__eh_frame) in libPods-novocaine-Novocaine.a(AudioFileReader.o)
      Dwarf Exception Unwind Info (__eh_frame) in libPods-novocaine-Novocaine.a(Novocaine.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have been looking around the other issues and I tried to change the compile source as to objective c++ and still nothing.

rodrigoelp commented 9 years ago

By the way, I am on xcode 6.1.1 (and 6.3) coding on swift for iOS 8.3... don't know if that is a big contributing factor.

zammitjames commented 9 years ago

I was receiving the same error so what I did was download the source files from Github and put them into my project manually without pods. Only way I managed to get them to work. Funnily enough using pods for Novocaine on Xcode 6.0 for iOS7 was fine but their seems to be some sort of conflict with Apple's last update of Xcode and Novocaine's framework. Make sure you disable ARC for their framework using "-fno-objc-arc" in the build phases tab. Let me know how things turn out !

benji-bou commented 9 years ago

Hi, I have the same errors, but only when trying to launch my unit test target. When I run in debug mode it works well. I installed NVDSP through cocoapods. Does anyone find a solution?

zammitjames commented 9 years ago

I wouldnt suggest using cocoapods for novocaine. It used to work fine on Xcode 6.0 for iOS 7.0, however with apple latest version of Xcode there seems to be some sort of conflict. I would suggest you download the source code and add the files to your project the old fashioned way. Drag and drop. Then go to the build phases tab of your project and disable arc using "-fno-objc-arc". It should work! Let me know how things turn out !

benji-bou commented 9 years ago

Yes, adding Nocaine manually in the project solves the problem. It's a bit strange. If someone know why this error occured and how to prevent it while using cocoapods should be great.

Thanks @zammitjames for your patch