I was trying to reinstall my ffmpeg, following this guide, on my ARM Ubuntu machine. Unfortunately, when I compile a program which uses this lib I get the following failure:
/usr/bin/ld: /usr/local/lib/libavcodec.a(amrnbdec.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libavcodec.a: could not read symbols: Bad value collect2: ld returned 1 exit status
Now I would like to recompile it with -fPIC
like the compiler is suggesting but I have no idea how. Any help is appreciated.
By "recompile with -Xlint", the compiler means to inform you that you need to recompile your program like this: javac -Xlint abc.java. If you do so, the compiler will tell you which methods are deprecated so you can remove your calls to them.
Note: Recompile with -Xlint:unchecked for details. How do I recompile with -Xlint:unchecked ? Are you compiling on the command line? If so, add the -Xlint:unchecked to the command line you're executing, just as the message indicates.
The javac -Xlint options control warnings for all files compiled in a particular run of javac . You may have identified specific locations in source code that generate warnings that you no longer want to see. You can use the @SuppressWarnings annotation to suppress warnings whenever that code is compiled.
Briefly, the error means that you can't use a static library to be linked w/ a dynamic one. The correct way is to have a libavcodec
compiled into a .so
instead of .a
, so the other .so
library you are trying to build will link well.
The shortest way to do so is to add --enable-shared
at ./configure
options. Or even you may try to disable shared (or static) libraries at all... you choose what is suitable for you!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With