Linker flags for one library break loading of another

Posted by trevrosen on Stack Overflow See other posts from Stack Overflow or by trevrosen
Published on 2010-03-21T20:09:58Z Indexed on 2010/03/21 20:11 UTC
Read the original article Hit count: 353

Filed under:

I'm trying to use FMOD and HTTPriot in the same app. FMOD works fine until I add in linker flags for HTTPriot, at which point I get a bunch of linking errors wherein FMOD is complaining about undefined symbols. In other words, adding in linker flags for HTTPriot seems to break the loading of FMOD's library.

These are the kinds of errors I'm getting, all coming during the linking phase of my build:

Undefined symbols:
  "_FMOD_Sound_Lock", referenced from:
      -[FMODEngine recordedSoundAsNSData] in FMODEngine.o
      -[FMODEngine writeRecordingToDiskWithName:] in FMODEngine.o
  "_FMOD_MusicSystem_PrepareCue", referenced from:
      -[FMODEngine addCue:] in FMODEngine.o

These are the linker flags for HTTPriot: -lhttpriot -lxml2 -ObjC -all_load

I added those as well as a path to the HTTPriot SDK per the instructions here: http://labratrevenge.com/httpriot/docs/iphone-setup.html

I was hoping someone could enlighten me on why adding linker flags for one library might cause a failure of another to load. If I DON'T have these flags in, HTTPriot and FMOD both work fine on the simulator, but HTTPriot has runtime errors on the device, I assume because its libraries are not linked. FMOD works fine on the device though.

I placed header search paths and library search paths in my build settings in order for XCode to find FMOD. That seemed to be OK until I tried adding these HTTPriot linker flags. I also tried adding a linker flag for the FMOD library (-lfmodex), but I get the same errors as I do without it.

© Stack Overflow or respective owner

Related posts about iphone