Ask Your Question
1

LIBTIFF_4.0 link errors

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

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 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
3

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

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 -0500 )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 -0500 )edit

Adding -DBUILD_TIFF=ON worked Thanks a lot

Yash101296 gravatar imageYash101296 ( 2015-06-23 15:40:50 -0500 )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 -0500 )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 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

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

Seen: 13,446 times

Last updated: Nov 03 '14