为什么cv2.so链接两个版本:libopencv_imgcodecs.so,libopencv_imgproc.so,libopencv_core.so

时间:2017-11-02 12:09:14

标签: python opencv

我在ubuntu 16.04中清理了opencv-3.1,然后在

时构建了3.3
ldd /usr/lib/python2.7/dist-packages/cv2.so|grep 3.1

它给出了:

...
/lib64/ld-linux-x86-64.so.2 (0x0000557321d2a000)
libopencv_imgcodecs.so.3.1 => not found
libopencv_imgproc.so.3.1 => not found
libopencv_core.so.3.1 => not found

你可以看到cv2.so(来自opencv 3.3)从opencv-3.1链接了三个不存在的

ldd /usr/lib/python2.7/dist-packages/cv2.so|grep libopencv_core

它给出了

libopencv_core.so.3.3 => /usr/lib/x86_64-linux-gnu/libopencv_core.so.3.3..
libopencv_core.so.3.1 => not found
显然,两个版本的libopencv_core被链接到cv2.so,任何人都可以告诉我:

how do this happened?
how to solve this problem?

我的步骤:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=$(python -c
"import sys; print(sys.prefix)") -D PYTHON_EXECUTABLE=$(which python) -D 
OPENCV_EXTRA_MODULES_PATH=/home/user/opencv_contrib/modules -D WITH_QT=ON -D         
WITH_OPENGL=ON -D WITH_IPP=ON -D WITH_OPENNI2=ON -D WITH_V4L=ON -D 
WITH_FFMPEG=ON -D WITH_GSTREAMER=OFF -D WITH_OPENMP=ON -D WITH_VTK=ON -D 
BUILD_opencv_java=OFF -D BUILD_opencv_python3=OFF -D WITH_CUDA=ON -D 
ENABLE_FAST_MATH=1 -D WITH_NVCUVID=ON -D CUDA_FAST_MATH=ON -D 
BUILD_opencv_cnn_3dobj=ON -D FORCE_VTK=ON -D WITH_TBB=ON -D WITH_CUBLAS=ON -
D CUDA_NVCC_FLAGS="-D_FORCE_INLINES" -D WITH_GDAL=ON -D WITH_XINE=ON ..

make -j 48

make install -j 48

0 个答案:

没有答案