在xcode中向项目添加库 - 未找到符号

gyo*_*dor 7 xcode linker objective-c pjsip

我想在xcode中使用pjsip制作一个iphone应用程序.问题是我不知道如何链接库.这是我第一次使用其他库,所以可能我做错了什么我只是不知道是什么.:(

我在mac os x中的这个文件夹中有ARM版本的库./用户/ kudorgyozo/pjsip_iphone

在Xcode中:我已经指定了库和头搜索路径,如下所示:

包括:

/ Users/kudorgyozo/pjsip_iphone/pjlib/include/Users/kudorgyozo/pjsip_iphone/pjlib-util/include/Users/kudorgyozo/pjsip_iphone/pjmedia/include/Users/kudorgyozo/pjsip_iphone/pjnath/include/Users/kudorgyozo/pjsip_iphone/pjsip /包括

对于图书馆:

/ Users/kudorgyozo/pjsip_iphone/pjlib/lib/Users/kudorgyozo/pjsip_iphone/pjlib-util/lib/Users/kudorgyozo/pjsip_iphone/pjmedia/lib/Users/kudorgyozo/pjsip_iphone/pjnath/lib/Users/kudorgyozo/pjsip_iphone/pjsip/lib目录

然后使用"其他链接器标志":

-lpj - 臂 - 苹果darwin9 -lpjlib-util的臂-苹果darwin9 -lpjmedia - 臂 - 苹果darwin9 -lpjmedia-AUDIODEV - 臂 - 苹果darwin9 -lpjmedia编解码器 - 臂 - 苹果darwin9 -lpjsdp臂 - 苹果-darwin9 -lpjnath - 臂 - 苹果darwin9 -lpjsip - 臂 - 苹果darwin9 -lpjsip-简单臂-苹果darwin9 -lpjsip-UA-臂苹果darwin9 -lpjsua - 臂 - 苹果darwin9

这样好吗?因为它给了我没有发现错误的符号.我认为"包含"库中没有找到符号.我不知道有什么问题我刚刚开始理解如何在基于Linux的系统下构建一个应用程序我以前只用C#编程.

编辑:这是缺少的符号列表:

"_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)
  "_srtp_deinit", referenced from:
      _pjmedia_srtp_deinit_lib in libpjmedia-arm-apple-darwin9.a(transport_srtp.o)
  "_gsm_encode", referenced from:
      _gsm_codec_encode in libpjmedia-codec-arm-apple-darwin9.a(gsm.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)
  "_speex_decoder_init", referenced from:
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_res_Resample", referenced from:
      _pjmedia_resample_run in libpjmedia-arm-apple-darwin9.a(resample_resample.o)
      _pjmedia_resample_run in libpjmedia-arm-apple-darwin9.a(resample_resample.o)
  "_speex_bits_write", referenced from:
      _spx_codec_encode in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_gsm_destroy", referenced from:
      _gsm_codec_close in libpjmedia-codec-arm-apple-darwin9.a(gsm.o)
      _gsm_codec_close in libpjmedia-codec-arm-apple-darwin9.a(gsm.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)
  "_speex_encoder_ctl", referenced from:
      _get_speex_info in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _get_speex_info in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _get_speex_info in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _get_speex_info in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _get_speex_info in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _get_speex_info in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _get_speex_info in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _get_speex_info in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_modify in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_modify in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_speex_encoder_init", referenced from:
      _get_speex_info in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.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)
  "_srtp_dealloc", referenced from:
      _pjmedia_transport_srtp_stop in libpjmedia-arm-apple-darwin9.a(transport_srtp.o)
      _pjmedia_transport_srtp_stop in libpjmedia-arm-apple-darwin9.a(transport_srtp.o)
      _pjmedia_transport_srtp_start in libpjmedia-arm-apple-darwin9.a(transport_srtp.o)
  "_speex_lib_get_mode", referenced from:
      _pjmedia_codec_speex_init in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _pjmedia_codec_speex_init in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_res_SrcLinear", referenced from:
      _pjmedia_resample_run in libpjmedia-arm-apple-darwin9.a(resample_resample.o)
      _pjmedia_resample_run in libpjmedia-arm-apple-darwin9.a(resample_resample.o)
  "_srtp_init", referenced from:
      _pjmedia_srtp_init_lib in libpjmedia-arm-apple-darwin9.a(transport_srtp.o)
  "_speex_bits_init", referenced from:
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.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)
  "_speex_decoder_destroy", referenced from:
      _spx_codec_close in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_AudioUnitInitialize", referenced from:
      _create_audio_unit in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_speex_bits_reset", referenced from:
      _spx_codec_encode in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.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)
  "_srtp_protect_rtcp", referenced from:
      _transport_send_rtcp2 in libpjmedia-arm-apple-darwin9.a(transport_srtp.o)
  "_speex_decode_int", referenced from:
      _spx_codec_recover in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_decode in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_speex_encoder_destroy", referenced from:
      _get_speex_info in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_close in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_gsm_create", referenced from:
      _gsm_codec_open in libpjmedia-codec-arm-apple-darwin9.a(gsm.o)
      _gsm_codec_open in libpjmedia-codec-arm-apple-darwin9.a(gsm.o)
  "_crypto_get_random", referenced from:
      _generate_crypto_attr_value in libpjmedia-arm-apple-darwin9.a(transport_srtp.o)
  "_speex_bits_unpack_unsigned", referenced from:
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_speex_encode_int", referenced from:
      _spx_codec_encode in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_octet_string_hex_string", referenced from:
      _pjmedia_transport_srtp_start in libpjmedia-arm-apple-darwin9.a(transport_srtp.o)
      _pjmedia_transport_srtp_start in libpjmedia-arm-apple-darwin9.a(transport_srtp.o)
  "_AudioSessionInitialize", referenced from:
      _ca_factory_init in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_speex_bits_read_from", referenced from:
      _spx_codec_parse in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_decode in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_speex_nb_mode", referenced from:
      _speex_nb_mode$non_lazy_ptr in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_res_GetXOFF", referenced from:
      _pjmedia_resample_create in libpjmedia-arm-apple-darwin9.a(resample_resample.o)
  "_gsm_decode", referenced from:
      _gsm_codec_decode in libpjmedia-codec-arm-apple-darwin9.a(gsm.o)
  "_speex_mode_query", referenced from:
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_speex_bits_advance", referenced from:
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_decode in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_AudioComponentGetDescription", referenced from:
      _ca_stream_get_cap in libpjmedia-audiodev-arm-apple-darwin9.a(coreaudio_dev.o)
  "_srtp_create", referenced from:
      _pjmedia_transport_srtp_start in libpjmedia-arm-apple-darwin9.a(transport_srtp.o)
      _pjmedia_transport_srtp_start in libpjmedia-arm-apple-darwin9.a(transport_srtp.o)
  "_speex_bits_remaining", referenced from:
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _speex_get_next_frame in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_srtp_unprotect_rtcp", referenced from:
      _srtp_rtcp_cb in libpjmedia-arm-apple-darwin9.a(transport_srtp.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)
  "_speex_decoder_ctl", referenced from:
      _spx_codec_modify in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_open in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_speex_bits_nbytes", referenced from:
      _spx_codec_encode in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_srtp_protect", referenced from:
      _transport_send_rtp in libpjmedia-arm-apple-darwin9.a(transport_srtp.o)
  "_speex_bits_destroy", referenced from:
      _spx_codec_close in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
      _spx_codec_close in libpjmedia-codec-arm-apple-darwin9.a(speex_codec.o)
  "_srtp_unprotect", referenced from:
      _srtp_rtp_cb in libpjmedia-arm-apple-darwin9.a(transport_srtp.o)
      _srtp_rtp_cb in libpjmedia-arm-apple-darwin9.a(transport_srtp.o)

有没有人为iphone构建pjsip并使用它创建了一个新项目?

Lau*_*ble 8

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.