cmake - OpenCV compile error Linking CXX shared library ../../lib/libopencv_highgui.so /lib/libbz2.so.1: could not read symbols: File in wrong format -
i'm trying install opencv-2.4.9 on centos 6.4. machine.
downloaded source in ~/downloads/opencv-2.4.9.
there, did 'mkdir build; cd build'. did
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 ..
and did 'make -j2'.
below message got (this result of re-running using '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: 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
i did search, no answers. can give me hint on what's wrong?
i had same problem , solution remove build file (or cmakecache.txt) , cmake again.
the problem cmake finds 32-bit library rather 64-bit one, should found in /lib64/libbz2.so or /usr/lib64/libbz2.so. cmake messed , keep using cached variable. if remove cache , cmake again, should find correct library.
Comments
Post a Comment