views:

99

answers:

2

I haven't found a solution for the exact problem I'm having, so perhaps someone here can help me.

I've created a static archive library that uses the AVAudioPlayer class and links against the AVFoundation framework. However, when I link my app against this static library, I receive the following linker error:

Undefined symbols:

"_OBJC_CLASS_$_AVAudioPlayer", referenced from:

objc-class-ref-to-AVAudioPlayer in ...

ld: symbol(s) not found
collect2: ld returned 1 exit status

How can I get this to compile without having to explicitly link to the AVFoundation framework in the application? I've already linked to it in the static lib, so that should be automatically picked up by the app.

A: 

I've already linked to it in the static lib, so that should be automatically picked up by the app.

This would be true if it were a dynamic library. Unfortunately static libraries cannot reference other (dynamic) libraries. So you will have to solve these dependencies at the application target.

St3fan
A: 

Ok thanks, I didn't realize that was the case. Thanks for taking the time to answer.

TooMuchTimeWastedAlready