0

I am working on a an application to stream live video on iPhone from IP cameras through rtsp. I am using open source projects like live555, DecoderWrapper and RTSPClient. I get the following error while compiling my project.

   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

I've already tried different solutions like checking if I had copied any frameworks to my projects. I've checked and there is nothing in "Framework search paths". As I am using "ffmpeg" in my project I've also tried compiling the library for i386 and then I added these libraries to my project. But nothing works! Can someone please help me? I can provide code details if needed.

Anila
  • 1,136
  • 2
  • 18
  • 42

1 Answers1

0

Double check your compilation stuff as it should be compiling for arm not i386. The fact it's bringing up architecture references for i386 makes me think it's trying to compile for desktop not iOS.

Nicholas Smith
  • 11,642
  • 6
  • 37
  • 55
  • Actually I want to build it for simulator first and I tried it because in some other posts it was suggested to do so for simulators. – Anila Aug 23 '11 at 10:10
  • Ah my bad sorry, if you look [here](http://blog.iosplace.com/?p=20) there's a how to on building libraries as fat ones containing the needed symbols for both arm and i386, that should help you get a bit further. – Nicholas Smith Aug 23 '11 at 10:21
  • Thanks a lot for the link. I'll try it and hope my prob will be solved. – Anila Aug 23 '11 at 10:40
  • Well it's not the same procedure for the libs I am using so yeah I'm still stuck! – Anila Aug 24 '11 at 07:27
  • Then hopefully StackOverflow will be to the rescue [as it seems you're not the first to get stuck on it](http://stackoverflow.com/questions/5516170/iphone-sdk-4-3-libav-compiling-problem) – Nicholas Smith Aug 24 '11 at 08:25
  • I have tried solutions given on different posts with similar problems but nothing seems to work. – Anila Aug 24 '11 at 11:05