Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while compiling the Xcode project (IPhone)

Tags:

iphone

ffmpeg

I added ffmpeg iphone port into my library and I can able to use a few of its functions like avcodec_init(),.. without any errors. But when I include this function call "avcodec_register_all" Xcode is giving error after compilation

The error message is :

*--------------- ld: ldr 12-bit displacement out of range (4276 max +/-4096) in _CFRelease$stub in _CFRelease$stub from /Users/foxit/Documents/CameraTest/build/CameraTest.build/Debug-iphoneos/CameraTest.build/Objects-normal/armv6/CameraTest

Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

*-------------

Does anyone know whats wrong with this ?

Regards,

Raghu

like image 371
Sridhar Bollam Avatar asked Mar 04 '10 15:03

Sridhar Bollam


1 Answers

This problem exists in iPhone OS 3.1 or later while building in Xcode. Try re-arringing the link order of the libraries in your target's link library phase. I have discussed this issue in: http://www.galloway.me.uk/2009/12/ldr-12-bit-displacement-out-of-range/

There is an inherent problem in iPhone SDK 3.1 and later. Will have to wait until Apple fixes it or we will have to do some trail and error changes.

In our case, just re-ordering libavfilter and libavcodec to the last would simply work.

like image 135
Raj Pawan Gumdal Avatar answered Sep 22 '22 17:09

Raj Pawan Gumdal