Error ".../libtool failed with exit code 1" while compiling

Discussion in 'iOS Programming' started by Aany, Aug 22, 2011.

  1. Aany macrumors newbie

    Joined:
    Jun 24, 2011
    Location:
    France
    #1
    I'm using three open source projects (live555, rtspClient and decodewrapper) in my application to be able to stream live video on iPhone from IP cameras through rtsp. The problem is that when I compile I get the following error.
    Code:
    /Developer/Tools/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: -dynamic not specified the following flags are invalid: -ObjC 
    /Developer/Tools/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: file: /Developer/Tools/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/libz.dylib is a dynamic library, not added to the static library
    /Developer/Tools/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: can't locate file for: -lavcodec
    /Developer/Tools/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: file: -lavcodec is not an object file (not allowed in a library)
    /Developer/Tools/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: can't locate file for: -lavdevice
    /Developer/Tools/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: file: -lavdevice is not an object file (not allowed in a library)
    /Developer/Tools/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: can't locate file for: -lavformat
    /Developer/Tools/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: file: -lavformat is not an object file (not allowed in a library)
    /Developer/Tools/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: can't locate file for: -lavutil
    /Developer/Tools/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: file: -lavutil is not an object file (not allowed in a library)
    /Developer/Tools/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: can't locate file for: -lswscale
    /Developer/Tools/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: file: -lswscale is not an object file (not allowed in a library)
    Command /Developer/Tools/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool failed with exit code 1
    I have no idea where does it come from or how to fix it. Can anyone please help me fix this problem? I can provide my code if needed.
     
  2. Aany thread starter macrumors newbie

    Joined:
    Jun 24, 2011
    Location:
    France
    #2
    Ok I've solved the first prob by building all the libraries separately and adding them to my project but now I am getting the following error.
    Code:
    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
    
    Any ideas?
     

Share This Page