编译错误:体系结构i386的未定义符号

时间:2011-08-23 09:49:21

标签: iphone xcode4 i386

我正在开发一个应用程序,通过rtsp从IP摄像机流式传输iPhone上的实时视频。我正在使用live555,DecoderWrapper和RTSPClient等开源项目。编译项目时出现以下错误。

   Undefined symbols for architecture i386:

   "_av_register_all", referenced from:

      +[VideoDecoder staticInitialize] in libDecoderWrapper.a(VideoDecoder.o)

  "_avcodec_init", referenced from:

      +[VideoDecoder staticInitialize] in libDecoderWrapper.a(VideoDecoder.o)

  "_av_log_set_callback", referenced from:

     +[VideoDecoder registerLogCallback:] in libDecoderWrapper.a(VideoDecoder.o)

  "_avcodec_find_decoder", referenced from:

     -[VideoDecoder initWithCodec:colorSpace:width:height:privateData:] in   libDecoderWrapper.a(VideoDecoder.o)

 "_avcodec_alloc_context", referenced from:

     -[VideoDecoder initWithCodec:colorSpace:width:height:privateData:] in     libDecoderWrapper.a(VideoDecoder.o)

  "_av_malloc", referenced from:

      -[VideoDecoder initWithCodec:colorSpace:width:height:privateData:] in libDecoderWrapper.a(VideoDecoder.o)

    -[VideoDecoder decodeFrame:] in libDecoderWrapper.a(VideoDecoder.o)

 "_avcodec_alloc_frame", referenced from:

    -[VideoDecoder initWithCodec:colorSpace:width:height:privateData:] in libDecoderWrapper.a(VideoDecoder.o)

 "_avcodec_open", referenced from:

    -[VideoDecoder initWithCodec:colorSpace:width:height:privateData:] in libDecoderWrapper.a(VideoDecoder.o)

  "_avcodec_decode_video2", referenced from:

      -[VideoDecoder decodeFrame:] in libDecoderWrapper.a(VideoDecoder.o)

  "_avpicture_get_size", referenced from:

      -[VideoDecoder decodeFrame:] in libDecoderWrapper.a(VideoDecoder.o)

  "_avpicture_fill", referenced from:

      -[VideoDecoder decodeFrame:] in libDecoderWrapper.a(VideoDecoder.o)

  "_sws_getContext", referenced from:

     -[VideoDecoder decodeFrame:] in libDecoderWrapper.a(VideoDecoder.o)

 "_sws_scale", referenced from:

     -[VideoDecoder getDecodedFrame] in libDecoderWrapper.a(VideoDecoder.o)

 "_avpicture_free", referenced from:

     -[VideoDecoder getDecodedFrame] in libDecoderWrapper.a(VideoDecoder.o)

 "_avpicture_alloc", referenced from:

     -[VideoDecoder getDecodedFrame] in libDecoderWrapper.a(VideoDecoder.o)

  "_av_picture_copy", referenced from:

     -[VideoDecoder getDecodedFrame] in libDecoderWrapper.a(VideoDecoder.o)

  "_av_free", referenced from:

     -[VideoDecoder dealloc] in libDecoderWrapper.a(VideoDecoder.o)

  "_avcodec_close", referenced from:

     -[VideoDecoder dealloc] in libDecoderWrapper.a(VideoDecoder.o)

ld: symbol(s) not found for architecture i386

collect2: ld returned 1 exit status

我已经尝试了不同的解决方案,例如检查我是否已将任何框架复制到我的项目中。我已经检查过“框架搜索路径”中没有任何内容。当我在我的项目中使用“ffmpeg”时,我也尝试为i386编译库,然后我将这些库添加到我的项目中。但没有任何作用!有人可以帮帮我吗?如果需要,我可以提供代码详细信息。

1 个答案:

答案 0 :(得分:0)

仔细检查你的编译内容,因为它应该为arm而不是i386进行编译。事实上,它为i386提供了架构参考,这让我觉得它正在尝试为桌面而不是iOS进行编译。