Adding libraries to a project in xcode - symbols not found

It seems that you are missing (at least) some libraries. From the symbols, I would say that:

  • You have probably forgot to add the CoreAudio framework. It is needed to resolve symbols like AudioUnitRender
  • There should be a RTP library from pjsip, something that contains pjrtp. If there is one, then add it to the Other Link Flags. That will fix the _srtp_XXX missing symbols.
  • There should be a GSM library from pjsip, something that contains gsm. If there is one, then add it to the Other Link Flags. That will fix the _srtp_XXX missing symbols.
  • There should be a Speex library from pjsip, something that contains speex. If there is one, then add it to the Other Link Flags. That will fix the _srtp_XXX missing symbols.

When encountering missing symbols, the best way to find where they are is:

  • Look at the symbol name. Good libraries always prefix their symbols, so from the name you can guess which library holds it.
  • If you have a set a static library and you want to know the symbols exported, then you can use the otool -Sv mystaticlib.a command. It will displays the table of content for the static library.

It seems I was stupid and didn't observe a folder called third-party. There are the missing libraries. In the docs theye were NOT mentioned so I didn't even bother looking in the other folders. I still have missing symbols but fewer (I think). I also included CoreAudio, I don't think it helped. I modified my project:

Added to the other linker flags:

-lg7221codec-arm-apple-darwin9 -lgsmcodec-arm-apple-darwin9 -lilbccodec-arm-apple-darwin9 -lmilenage-arm-apple-darwin9 -lresample-arm-apple-darwin9 -lspeex-arm-apple-darwin9 -lsrtp-arm-apple-darwin9

And to the library search paths:

/Users/kudorgyozo/pjsip_iphone/third_party/lib

I don't have to modify the header search path's or include new headers i THINK.

Here's what is missing now:

  "_AudioSessionSetProperty", referenced from:
      _create_audio_unit in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _ca_stream_set_cap in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _ca_stream_set_cap in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_AudioComponentInstanceNew", referenced from:
      _create_audio_unit in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_AudioSessionAddPropertyListener", referenced from:
      _ca_stream_start in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_AudioComponentInstanceDispose", referenced from:
      _propListener in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _ca_stream_destroy in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_AudioSessionGetProperty", referenced from:
      _ca_stream_get_cap in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _ca_stream_get_cap in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _ca_stream_get_cap in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _ca_stream_get_cap in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _ca_stream_get_cap in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _ca_stream_get_cap in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _ca_stream_get_cap in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_AudioComponentFindNext", referenced from:
      _ca_stream_set_cap in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _ca_factory_init in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_AudioSessionSetActive", referenced from:
      _ca_stream_stop in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _ca_stream_start in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_AudioUnitRender", referenced from:
      _input_callback in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_AudioUnitSetProperty", referenced from:
      _create_audio_unit in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _create_audio_unit in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _create_audio_unit in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _create_audio_unit in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _create_audio_unit in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _create_audio_unit in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _create_audio_unit in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_AudioUnitUninitialize", referenced from:
      _propListener in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _ca_stream_destroy in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_AudioUnitInitialize", referenced from:
      _create_audio_unit in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_AudioOutputUnitStop", referenced from:
      _ca_stream_stop in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _ca_stream_stop in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _ca_stream_start in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
      _interruptionListener in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_AudioSessionInitialize", referenced from:
      _ca_factory_init in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_AudioComponentGetDescription", referenced from:
      _ca_stream_get_cap in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_AudioOutputUnitStart", referenced from:
      _ca_stream_start in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_AudioSessionRemovePropertyListenerWithUserData", referenced from:
      _ca_stream_destroy in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
ld: symbol(s) not found

It seems to me all are from this file libpjmedia-audiodev-arm-apple-darwin9.a but i have included it in the linker flags an in the lib search paths.

I was able to build it successfully. The missing framework was AudioToolbox. Did a google search for AudioSessionSetProperty and that is how i found out. Thanks for help.