【问题标题】:Compilation Error: Undefined symbols for architecture i386编译错误:体系结构 i386 的未定义符号
【发布时间】:2011-08-23 09:49:21
【问题描述】:

我正在开发一个应用程序,通过 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 编译库,然后将这些库添加到我的项目中。但没有任何效果!有人可以帮帮我吗?如果需要,我可以提供代码详细信息。

【问题讨论】:

  • 看看有没有错过添加任何Framework
  • @EmptyStack我检查了又重新检查,我认为我没有遗漏任何框架。

标签: iphone xcode4 i386


【解决方案1】:

仔细检查您的编译内容,因为它应该为 arm 而不是 i386 编译。它为 i386 提供架构参考的事实让我认为它正在尝试为桌面而不是 iOS 编译。

【讨论】:

  • 实际上我想先为模拟器构建它,我尝试过,因为在其他一些帖子中建议为模拟器这样做。
  • 我很抱歉,如果您查看 here,这里有一个如何将库构建为包含 arm 和 i386 所需符号的胖库,这应该可以帮助您走得更远。跨度>
  • 非常感谢您的链接。我会尝试一下,希望我的问题能得到解决。
  • 嗯,这与我使用的库不同,所以是的,我仍然卡住了!
  • 那么希望 StackOverflow 能够拯救as it seems you're not the first to get stuck on it
猜你喜欢
  • 1970-01-01
  • 2013-06-25
  • 1970-01-01
  • 2011-09-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多