


Why Am I Getting 'Relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object' Error While Compiling ffmpeg?
Nov 10, 2024 pm 02:37 PMError While Compiling with ffmpeg: "Relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC"
While attempting to reinstall ffmpeg on an ARM Ubuntu system, a compilation error was encountered when using a program that utilized the ffmpeg library. The error message indicated:
/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
This error arises from an attempt to link a static library (.a) with a dynamic one (.so). To resolve this issue, it is necessary to recompile ffmpeg with the -fPIC flag.
Recompiling with -fPIC
Adding the --enable-shared flag during ./configure will instruct ffmpeg to build as a dynamic library. Alternatively, you can choose to disable static libraries completely if preferred.
Once the ffmpeg library has been recompiled with -fPIC, the compilation should proceed successfully without the aforementioned error.
The above is the detailed content of Why Am I Getting 'Relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object' Error While Compiling ffmpeg?. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

What are the types of values returned by c language functions? What determines the return value?

What are the definitions and calling rules of c language functions and what are the

C language function format letter case conversion steps

Where is the return value of the c language function stored in memory?

How do I use algorithms from the STL (sort, find, transform, etc.) efficiently?

How does the C Standard Template Library (STL) work?
