在ubuntu下安装opencv和PCL时 undefined reference to `TIFFReadDirectory@LIBTIFF_4.0

声明:本文系转载自 https://blog.csdn.net/u011361393/article/details/83210824

在ubuntu下安装opencv和PCL时,遇到如下错误 undefined reference to `TIFFReadDirectory@LIBTIFF_4.0

/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFReadDirectory@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFIsTiled@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFDefaultStripSize@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFReadTile@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFWriteScanline@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `_TIFFfree@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFGetField@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFScanlineSize@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFClose@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFClientOpen@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFGetFieldDefaulted@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFNumberOfDirectories@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFOpen@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFReadRGBAImage@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFSetField@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFSetWarningHandler@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFSetErrorHandler@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `_TIFFmalloc@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFSetDirectory@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFReadScanline@LIBTIFF_4.0'
/usr/lib/libvtkIO.so.5.10.1: undefined reference to `TIFFNumberOfTiles@LIBTIFF_4.0'

其原因时安装的libtiff库和opencv和PLC中调用的libtiff库版本与安装的版本不对应,去libtiff官网上下载 tiff-4.0.4.tar.gz压缩包安装即可。安装方法如下:

解压tar -zxvf tiff-4.0.4.tar.gz
进入tiff目录

./configure
make
make install

网上有介绍通过sudo apt-get install libtiff4-dev安装,但是运行该命令后,提示libtiff4-dev已经被libtiff5-dev替代,只可安装libtiff5-dev,安装后并未解决问题。

你可能感兴趣的:(ubuntu相关)