静态库没有fPIC编译, 只要在configure时加上--enable-shared即可, 即: ./configure --enable-shared

编译opencv4.5.3的时候出现错误

/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: 最后的链结失败: bad value
collect2: error: ld returned 1 exit status
make[2]: * [modules/world/CMakeFiles/opencv_world.dir/build.make:8801:lib/libopencv_world.so.4.5.3] 错误 1
make[1]: * [CMakeFiles/Makefile2:2093:modules/world/CMakeFiles/opencv_world.dir/all] 错误 2
make: * [Makefile:163:all] 错误 2

将ffmpeg换成动态库编译就可以了。

本文链接地址:https://const.net.cn/452.html

标签: ffmpeg

添加新评论