Ask Your Question
2

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 libtiff.so pointing to libtiff.so.5->libtiff.so.5.2.0 in /usr/local/lib.

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

edit retag flag offensive close merge delete

Comments

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
3

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

Comments

1

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: libtiff.so.4: 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
1

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:

cmake -D CMAKE_BUILD_TYPE=RELEASE \
            -D CMAKE_INSTALL_PREFIX=$cwd/installation/OpenCV-"$cvVersion" \
            -D INSTALL_C_EXAMPLES=ON \
            -D INSTALL_PYTHON_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_EXAMPLES=ON
        -D BUILD_TIFF=ON ..
edit flag offensive delete link more

Question Tools

Stats

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

Seen: 23,335 times

Last updated: Jul 15 '19