relocation R_X86_64_PC32 against symbol can not be used when making a shared object recompile with

错误:

/usr/bin/ld: /usr/local/lib/libavcodec.a(vc1dsp_mmx.o): relocation R_X86_64_PC32 against symbol `ff_pw_9' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

网上所有教程,都说加-fPIC。大多情况下有用,个别情况下没用。比如编译FFmpeg。这个时候,你需要如下操作: 

export ECFLAG="-fPIC"
./configure \
--extra-cflags="-fPIC " \

 

你可能感兴趣的:(C/C++)