Ask Your Question

LIBTIFF_4.0 link errors

asked 2014-06-24 14:30:08 -0600

funWithImages gravatar image

I build opencv-2.4.9 successfully (it seemed) on Linux x86_64. When I then build an application that used highgui I get the following errors.

Can you tell me why I am getting this and how to fix it? I have pointing to> in /usr/local/lib.

1> /usr/lib/ undefined reference to TIFFIsTiled@LIBTIFF_4.0' 1> /usr/lib/ undefined reference toTIFFOpen@LIBTIFF_4.0' 1> /usr/lib/ undefined reference to TIFFReadEncodedStrip@LIBTIFF_4.0' 1> /usr/lib/ undefined reference toTIFFSetField@LIBTIFF_4.0' 1> /usr/lib/ undefined reference to TIFFWriteScanline@LIBTIFF_4.0' 1> /usr/lib/ undefined reference toTIFFGetField@LIBTIFF_4.0' 1> /usr/lib/ undefined reference to TIFFScanlineSize@LIBTIFF_4.0' 1> /usr/lib/ undefined reference toTIFFSetWarningHandler@LIBTIFF_4.0' 1> /usr/lib/ undefined reference to TIFFSetErrorHandler@LIBTIFF_4.0' 1> /usr/lib/ undefined reference toTIFFReadEncodedTile@LIBTIFF_4.0' 1> /usr/lib/ undefined reference to TIFFReadRGBATile@LIBTIFF_4.0' 1> /usr/lib/ undefined reference toTIFFClose@LIBTIFF_4.0' 1> /usr/lib/ undefined reference to TIFFRGBAImageOK@LIBTIFF_4.0' 1> /usr/lib/ undefined reference toTIFFReadRGBAStrip@LIBTIFF_4.0'

edit retag flag offensive close merge delete


Just want to say thank you for showing this. I was compiling opencv with ffmpeg for 2 days until i saw this.

mrdgw123 gravatar imagemrdgw123 ( 2016-03-01 09:12:47 -0600 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2014-11-03 11:51:39 -0600

Will gravatar image

Unfortunately, OpenCV currently needs libtiff4, which Ubuntu 14.04 has dropped from their packaging system. As a workaround, specify -DBUILD_TIFF=ON to CMake when configuring OpenCV. This will have OpenCV build the distributed version of libtiff4, and should solve your linker problems.

Hope that helps!

edit flag offensive delete link more



I tried this, re-did cmake with that option (-DBUILD_TIFF=ON) included and the cmake return showed: -- TIFF: build (ver 42 - 4.0.2) however when I tried to run the demo I still got ./facedetect: error while loading shared libraries: cannot open shared object file: No such file or directory

biaspoint gravatar imagebiaspoint ( 2014-12-29 23:00:04 -0600 )edit

I now realize that I had an old PATH after my re-install of 14.04 that I thought was gone and it was linking to an older OpenCV (2.4) folder/file that was within the ROS install. I removed the PATH and also upgraded ROS to OpenCV 3.0. I think either would have worked alone.

sudo apt-get install ros-hydro-opencv3
biaspoint gravatar imagebiaspoint ( 2014-12-30 11:41:27 -0600 )edit

Adding -DBUILD_TIFF=ON worked Thanks a lot

Yash101296 gravatar imageYash101296 ( 2015-06-23 15:40:50 -0600 )edit

Adding -QMAKE_CXXFLAGS += -DBUILDTIFF=ON in qt creator didnt work for me. Any idea why?

Raman gravatar imageRaman ( 2016-06-18 00:42:51 -0600 )edit

Same error on: Ubuntu 16.04, OpenCV 3.2.0. Adding -D WITH_TIFF=ON -D BUILD_TIFF=ON worked for me. Thx!

RodenLuo gravatar imageRodenLuo ( 2017-03-23 23:18:44 -0600 )edit

answered 2019-07-13 00:13:32 -0600

GaryB gravatar image

updated 2019-07-15 22:04:38 -0600

supra56 gravatar image

One working config script that works: Ubuntu 18.04, OpenCV 4.X master:

            -D CMAKE_INSTALL_PREFIX=$cwd/installation/OpenCV-"$cvVersion" \
            -D INSTALL_C_EXAMPLES=ON \
            -D WITH_TBB=ON \
            -D WITH_V4L=ON \
            -D OPENCV_PYTHON3_INSTALL_PATH=$cwd/OpenCV-$cvVersion-py3/lib/python3.5/site-packages \
        -D WITH_QT=ON \
        -D WITH_OPENGL=ON \
        -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
        -D BUILD_TIFF=ON ..
edit flag offensive delete link more

Question Tools


Asked: 2014-06-24 14:30:08 -0600

Seen: 22,880 times

Last updated: Jul 15 '19