In Xcode 4.3.2, building an iPad app, which includes libavutil.a
from the ffmpeg distribution, it builds and runs correctly but when I try to run unit tests (Cm
I solved this linker error by enabling Position-Independent Code in the compiler and linker settings in XCode.
The answer, from here.
is to add:
-read_only_relocs suppress
to the linker flags.
The other link explains why. The solution was originally found here.
Just to be specific, the line that specifically worked to fix a similar linking error with ffmpeg
for 32bit OSX
link using xcode/c++11
, was to add -Wl,-read_only_relocs,suppress
to the link line. Variations of this didn't work.
For those who have read answers above but it did not help, check your "Product -> Scheme -> Edit Scheme". It should be "debug" for simulator and for device it does not matter. Otherwise you will get strange bugs like it cannot see some parts of your project.