gpt4 book ai didi

opencv - Ubuntu 14.04 安装opencv3.0,遇到重定位错误

转载 作者:行者123 更新时间:2023-12-04 23:34:14 59 4
gpt4 key购买 nike

这是我的制作日志:

[  3%] Built target libwebp
[ 3%] Built target opencv_cudev
[ 7%] Built target opencv_ts_pch_dephelp
[ 7%] Built target pch_Generate_opencv_ts
[ 7%] Built target opencv_core_pch_dephelp
[ 7%] Built target pch_Generate_opencv_core
[ 11%] Built target opencv_core
[ 11%] Built target opencv_imgproc_pch_dephelp
[ 11%] Built target pch_Generate_opencv_imgproc
[ 15%] Built target opencv_imgproc
[ 15%] Built target opencv_imgcodecs_pch_dephelp
[ 15%] Built target pch_Generate_opencv_imgcodecs
[ 15%] Built target opencv_imgcodecs
[ 15%] Built target opencv_videoio_pch_dephelp
[ 15%] Built target pch_Generate_opencv_videoio
Linking CXX shared library ../../lib/libopencv_videoio.so
/usr/bin/ld: /usr/local/lib/libavformat.a(rmsipr.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavformat.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,一开始,在 ffmpeg 中制作遇到了类似的问题,但是在我使用此命令进行配置后:
./configure --prefix=.. --enable-shared --enable-gpl --enable-version3 --enable-runtime-cpudetect --disable-outdev=sdl --disable-opencl --enable-libmp3lame --enable-libx264 --cc="gcc -m64 -fPIC" --extra-cflags="-I../include" --extra-ldflags="-L../lib -ldl"

ffmpeg 已建成。

但是opencv make错误仍然存​​在..

搜索了很多,找不到解决方案。

最佳答案

基本上根据这篇文章重新制作 x264 和 ffmpeg:http://www.ozbotz.org/opencv-installation-2-3-1/ (记得在配置x264和ffmpeg的时候加上--enable-shared)就可以解决这个问题。

关于opencv - Ubuntu 14.04 安装opencv3.0,遇到重定位错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29266651/

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