xcode - Add AVFountation Framework

你说的曾经没有我的故事 提交于 2019-12-01 03:17:31

问题


I'm creating an iphone app using xcode 4.2, and trying to use the AVFoundation Framework to play some radio stream.
When i import it to the project's frameworks and the build, i get the following warning:

ld: warning: ignoring file /Users/xanthos/Documents/tabbartest/AVFoundation.framework/AVFoundation, file was built for unsupported file format which is not the architecture being linked (i386)

and of course when using anything of the framework (eg AVAudioSession) i get errors like:

Undefined symbols for architecture i386: "_OBJC_CLASS_$_AVAudioSession", referenced from: objc-class-ref in RadioStreamer.o

I've read so many posts about how to compile AVFoundation Library, by i really don't get it, i'm really inexperienced in all these. I can see there's something with the linking of the library, but not completely understand it.

Any clues please?
Thank you in advance.


回答1:


It looks like you have you copied AVFoundation.framework from somewhere to your project directory. That's wrong. You just need to add it to the "Link Binary With Libraries" build phase of your project:

  1. In Xcode, select the project in the navigator on the left.
  2. Select the 'Build phases' tab in the main area in the middle.
  3. Open up the 'Link Binary With Libraries' section.
  4. Click the '+'.
  5. Select `AVFoundation.framework. and click 'Add'.


来源:https://stackoverflow.com/questions/9864441/xcode-add-avfountation-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!