编译ffmpeg的relocation R_X86_64_32 against错误

/usr/bin/ld: /usr/local/lib/mysql/libz.a(compress.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/mysql/libz.a: could not read symbols: Bad value
...
编译器提示:recompile with -fPIC

两种方式:

(1)在makefile文件里的CFLAGS里加上 -fPIC选项,这样可以一劳永逸

(2)如果你的makefile很大,CFLAGS也不明确,那就在编译时手动加上,即:

CFLAGS="-fPIC" ./configure ..............

如果这样还不行,你需要试一下sudo

即:

sudo   CFLAGS="-fPIC" ./configure ..............
点赞