我只是在liunx上运行下面两行代码。
sudo apt-get autoremove
sudo apt-get -f install结果再次运行,cpp写的有关于opencv 的代码。
******************************
错误如下:
sr/bin/ld: warning: libgtkglext-x11-1.0.so.0, needed by /usr/local/lib/libopencv_highgui.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libgdkglext-x11-1.0.so.0, needed by /usr/local/lib/libopencv_highgui.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libgdal.so.1, needed by /usr/local/lib/libopencv_imgcodecs.so, not found (try using -rpath or -rpath-link)
/usr/local/lib/libopencv_highgui.so: undefined reference to `gtk_widget_get_gl_window'
/usr/local/lib/libopencv_highgui.so: undefined reference to `gdk_gl_drawable_make_current'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `GDALDataset::GetRasterBand(int)@GDAL_1.8'
/usr/local/lib/libopencv_highgui.so: undefined reference to `gtk_widget_set_gl_capability'
/usr/local/lib/libopencv_highgui.so: undefined reference to `gdk_gl_config_new_by_mode'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `GDALColorTable::GetColorEntry(int) const@GDAL_1.8'
/usr/local/lib/libopencv_highgui.so: undefined reference to `gdk_gl_drawable_gl_end'
/usr/local/lib/libopencv_highgui.so: undefined reference to `gtk_widget_get_gl_context'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `GDALColorTable::GetPaletteInterpretation() const@GDAL_1.8'
/usr/local/lib/libopencv_highgui.so: undefined reference to `gdk_gl_drawable_is_double_buffered'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `GDALRasterBand::RasterIO(GDALRWFlag, int, int, int, int, void*, int, int, GDALDataType, int, int)@GDAL_1.8'
/usr/local/lib/libopencv_highgui.so: undefined reference to `gdk_gl_drawable_gl_begin'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `GDALRasterBand::GetRasterDataType()@GDAL_1.8'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `GDALDataset::GetRasterXSize()@GDAL_1.8'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `GDALClose@GDAL_1.8'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `GDALGetDataTypeName@GDAL_1.8'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `GDALDataset::GetRasterCount()@GDAL_1.8'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `GDALOpen@GDAL_1.8'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `GDALAllRegister@GDAL_1.8'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `GDALRasterBand::GetYSize()@GDAL_1.8'
/usr/local/lib/libopencv_highgui.so: undefined reference to `gdk_gl_drawable_swap_buffers'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `GDALDataset::GetRasterYSize()@GDAL_1.8'
/usr/local/lib/libopencv_highgui.so: undefined reference to `gdk_gl_drawable_get_type'
/usr/local/lib/libopencv_highgui.so: undefined reference to `gtk_gl_init'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `GDALRasterBand::GetXSize()@GDAL_1.8'
collect2: error: ld returned 1 exit status
CMakeFiles/arcsoft_afd_cv.dir/build.make:83: recipe for target 'arcsoft_afd_cv' failed
make[2]: *** [arcsoft_afd_cv] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/arcsoft_afd_cv.dir/all' failed
make[1]: *** [CMakeFiles/arcsoft_afd_cv.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
***************************************
solved-----
==========================================================
sudo apt-get install libgtkglext1
sudo apt-get install libgdal-dev
sudo apt-get install libpng-dev