gpt4 book ai didi

c++ - 在 Debian 上编译 OpenCV (C++) 时出错

转载 作者:行者123 更新时间:2023-11-28 04:25:45 25 4
gpt4 key购买 nike

[  9%] Built target libwebp
[ 15%] Built target IlmImf
[ 17%] Built target ippiw
[ 23%] Built target libprotobuf
[ 24%] Built target quirc
[ 24%] Built target ittnotify
[ 24%] Built target opencv_test_core_pch_dephelp
[ 24%] Built target opencv_core_pch_dephelp
[ 24%] Built target opencv_ts_pch_dephelp
[ 24%] Built target pch_Generate_opencv_ts
[ 24%] Built target pch_Generate_opencv_core
make[2]: Warning: File '/usr/lib/x86_64-linux-gnu/libz.so' has modification time 2220 s in the future
[ 24%] Linking CXX shared library ../../lib/libopencv_core.so
make[2]: warning: Clock skew detected. Your build may be incomplete.
[ 31%] Built target opencv_core
[ 31%] Built target opencv_imgproc_pch_dephelp
[ 31%] Built target pch_Generate_opencv_imgproc
[ 31%] Linking CXX shared library ../../lib/libopencv_imgproc.so
[ 37%] Built target opencv_imgproc
[ 37%] Built target opencv_imgcodecs_pch_dephelp
[ 37%] Built target pch_Generate_opencv_imgcodecs
make[2]: Warning: File '/usr/lib/x86_64-linux-gnu/libz.so' has modification time 2217 s in the future
[ 37%] Linking CXX shared library ../../lib/libopencv_imgcodecs.so
make[2]: warning: Clock skew detected. Your build may be incomplete.
[ 39%] Built target opencv_imgcodecs
[ 39%] Built target opencv_videoio_pch_dephelp
[ 39%] Built target pch_Generate_opencv_videoio
[ 39%] Linking CXX shared library ../../lib/libopencv_videoio.so
/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
make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:231: lib/libopencv_videoio.so.4.0.1] Error 1
make[1]: *** [CMakeFiles/Makefile2:3712: modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

当我尝试使用命令“make”编译 OpenCV 时,它总是出现这些错误。我尝试了 OpenCV 3.4.5 4.0.1。我已经安装了 OpenCV 需要的所有库。

最佳答案

您对当前日期和时间有疑问

  • 关于标准库,出现类似Warning: File '/usr/lib/x86_64-linux-gnu/libz.so' has modification time 2220 s in the future 的消息是不正常的

  • 正如您通过消息看到的那样“警告:检测到时钟偏差。您的构建可能不完整。”您打扰了make,它使用日期和时间重新编译或不重新编译(即使在您的情况下也可能全部编译,因为还没有完成任何对象/库)

所以您真的需要更新操作系统上的日期和时间,激活ntp

/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"

Makefile 是通过configure 生成的,以具有正确的编译器选项,它认为您需要修改configure.in 以添加-fPIC

很难说更多,因为你甚至没有指出你的 linux/其他 OS 发行版......

关于c++ - 在 Debian 上编译 OpenCV (C++) 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54377348/

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