opencv在编译报错的汇总

Q1:


xuy@xuy:~/桌面/opencv_test$ make
/usr/bin/cmake: /home/xuy/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /home/xuy/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /home/xuy/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/bin/cmake: /home/xuy/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
[100%] /usr/bin/cmake: /home/xuy/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
Building CXX object CMakeFiles/DisplayImage.dir/DisplayImage.cpp.o
/usr/bin/cmake: /home/xuy/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
Linking CXX executable DisplayImage
/usr/bin/cmake: /home/xuy/anaconda2/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFReadDirectory@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFWriteEncodedStrip@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFIsTiled@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFOpen@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFReadEncodedStrip@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFSetField@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFWriteScanline@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFGetField@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFScanlineSize@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFNumberOfStrips@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFSetWarningHandler@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFSetErrorHandler@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFReadEncodedTile@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFReadRGBATile@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFClose@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFRGBAImageOK@LIBTIFF_4.0’未定义的引用
/usr/local/lib/libopencv_imgcodecs.so.3.0.0:对‘TIFFReadRGBAStrip@LIBTIFF_4.0’未定义的引用
collect2: error: ld returned 1 exit status
make[2]: *** [DisplayImage] 错误 1
make[1]: *** [CMakeFiles/DisplayImage.dir/all] 错误 2
make: *** [all] 错误 2


Answer1:

参考这个链接:https://serverfault.com/questions/696631/libcurl-so-4-no-version-information-available


原因是软连接没做好:

sudo ln -fs /usr/lib/libcurl.so.4 /usr/local/lib/
Q2:

使用opencv打开图像时报错: 
error: /io/opencv/modules/highgui/src/window.cpp:565: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvNamedWindow

但检查发现gtk什么的已经安装了…… 
解决方法: 

http://www.seekjune.com/post/14094

sudo apt-get install python-opencv 
同时卸载之前安装的opencv-python 
sudo pip uninstall opencv-python

Q3:
 
  

error message below

error Traceback (most recent call last)
in ()
----> 1 cv2.imshow('hi',img)
error: /feedstock_root/build_artefacts/work/opencv-3.1.0/modules/highgui/src/window.cpp:545: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage

解决办法:https://github.com/conda-forge/opencv-feedstock/issues/43
 
  
conda install -c loopbio ffmpeg-feature gtk2-feature opencv

 
 

你可能感兴趣的:(opencv)