gpt4 book ai didi

OpenCV make 失败 - "recompile with -fPIC"

转载 作者:太空宇宙 更新时间:2023-11-03 20:44:44 26 4
gpt4 key购买 nike

我正在 Ubuntu 13.10 上安装一些 OpenCV,看起来有些不愉快。我经历了几个版本和安装方法,当我执行“make”或“make -j4”时,make trucks 一直运行到

/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.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/libavcodec.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libopencv_videoio.so.3.0.0] Error 1
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make: *** [all] Error 2

感谢任何帮助。再次感谢,罗伯特。

最佳答案

我在启用 FFMPEG 的 Ubuntu 14.04 上编译 opencv3 alpha 时遇到了同样的问题。我的 FFMPEG 是用编译的 git 版本
./configure
make
make install

我不得不重新编译 FFMPEG
./configure --enable-nonfree --enable-pic <strong>--enable-shared</strong>

这对我有用,之后 opencv3 编译正常。

关于OpenCV make 失败 - "recompile with -fPIC",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25539034/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com