gpt4 book ai didi

OpenCV编译错误Linking CXX共享库../../lib/libopencv_highgui.so/lib/libbz2.so.1 : could not read symbols: File in wrong format

转载 作者:行者123 更新时间:2023-12-02 16:13:45 24 4
gpt4 key购买 nike

我正在尝试在我的 CentOS 6.4 上安装 OpenCV-2.4.9。机器。
我在 ~/Downloads/opencv-2.4.9 中下载了源代码。
从那里,我做了'mkdir build;光盘构建'。然后做了

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON --enable-shared ..

并做了“make -j2”。
以下是我收到的消息(这是仅使用“make”重新运行的结果)

[  3%] Built target libtiff
[ 4%] Built target opencv_core_pch_dephelp
[ 4%] Built target pch_Generate_opencv_core
[ 6%] Built target opencv_core
[ 6%] Built target opencv_ts_pch_dephelp
[ 6%] Built target pch_Generate_opencv_ts
[ 6%] Built target opencv_imgproc_pch_dephelp
[ 7%] Built target pch_Generate_opencv_imgproc
[ 11%] Built target opencv_imgproc
[ 11%] Built target opencv_flann_pch_dephelp
[ 11%] Built target pch_Generate_opencv_flann
[ 12%] Built target opencv_flann
[ 12%] Built target opencv_highgui_pch_dephelp
[ 12%] Built target pch_Generate_opencv_highgui
Linking CXX shared library ../../lib/libopencv_highgui.so
/lib/libbz2.so.1: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[2]: *** [lib/libopencv_highgui.so.2.4.9] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2

我做了一些搜索,但没有好的答案。谁能告诉我哪里出了问题?

最佳答案

我有同样的问题,我的解决方案是删除所有构建文件(或 CMakeCache.txt)并再次 cmake。

问题是cmake找到的是32位库而不是64位库,应该在/lib64/libbz2.so或/usr/lib64/libbz2.so中找到。有时 cmake 会搞砸并继续使用缓存的变量。因此,如果您删除缓存并再次 cmake,它应该会找到正确的库。

关于OpenCV编译错误Linking CXX共享库../../lib/libopencv_highgui.so/lib/libbz2.so.1 : could not read symbols: File in wrong format,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26902541/

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