Solvedcolmap Undefined reference to libtiff4.0 on compile (Ubuntu 16.04)

I have all the dependencies installed on Ubuntu 16.04 (cmake, build-essential, libboost-all-dev, libeigen3-dev, libsuitesparse-dev, libfreeimage-dev, libgoogle-glog-dev, libgflags-dev, libglew-dev, qt5-default, and ceres solver.

When I run 'make -j' in the build folder, I get this error and a few more repeated instances of this undefined reference.

Does anyone know of a solution? I found this thread:!topic/colmap/Fjo3kQIpd_U
but no solution was suggested.


/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFReadEncodedStrip@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFReadEXIFDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFFieldReadCount@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFSetTagExtender@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFCurrentDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFReadTile@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFSetDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFClientOpen@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFSetField@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFScanlineSize@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFWriteDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFTileRowSize@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFWriteScanline@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFGetFieldDefaulted@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFReadDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFIsTiled@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFFieldDataType@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFSwabArrayOfLong@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFMergeFieldInfo@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFLastDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `_TIFFDataSize@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFSetSubDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFFieldPassCount@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFFieldWithTag@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFReadRGBAImage@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFClose@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFGetTagListCount@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFDefaultStripSize@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFFieldTag@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFGetTagListEntry@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFComputeStrip@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFDataWidth@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFFieldName@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFIsByteSwapped@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFGetField@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFTileSize@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ undefined reference to `TIFFStripSize@LIBTIFF_4.0'
collect2: error: ld returned 1 exit status
src/mvs/CMakeFiles/normal_map_test.dir/build.make:163: recipe for target 'src/mvs/normal_map_test' failed
make[2]: *** [src/mvs/normal_map_test] Error 1
21 Answers

✔️Accepted Answer

Tried all of the above what finally worked for me was

conda uninstall libtiff

Other Answers:

A solution that worked for me is to do the installation with a terminal instance without anaconda defined in the path:

  1. comment out anaconda path in ~/.bashrc:
    #export PATH="/home/daniyar/anaconda3/bin:$PATH"
  2. start a new terminal and proceed installation with
    cmake .. or CC=/usr/bin/gcc-6 CXX=/usr/bin/g++-6 cmake ..
  3. put back anaconda path in ~/.bashrc:
    export PATH="/home/daniyar/anaconda3/bin:$PATH"

In fact, running cmake .. with anaconda in the path throws a warnings like:
``runtime library [] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /home/daniyar/anaconda3/lib`

A solution to a similar link error with undefined references was suggested here: lagadic/visp#109

Thanks to @SBCV , I read my cmake output again carefully, and I realized that the error was due to incorrect Qt path found by cmake. The message it looks like this:

In the circled part, cmake uses the Qt in anaconda directory, which suggest why I got the warnings mentioned by @dantkz :
runtime library [] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /home/damon/anaconda2/lib

So, I added one line to CMakeLists.txt in top directory(in colmap folder),
SET(CMAKE_PREFIX_PATH "/usr/lib/x86_64-linux-gnu/cmake")

this forces cmake to use system's Qt.
Then run
cmake .. in build folder, warnings was gone, and make was fine after that.

In my case colmap was automatically using qt5.6 in the anaconda3 paths.
By manually installing qt5.7 following for Ubuntu 14.04 and adjusting the paths the libfreeimage linking errors disappeared

@anubhavashok you save me

Related Issues:

colmap Undefined reference to libtiff4.0 on compile (Ubuntu 16.04)
Tried all of the above what finally worked for me was I have all the dependencies installed on Ubunt...
ssd.pytorch ValueError: not enough values to unpack (expected 2, got 0)
I changed the code as follows and worked for me In of line 62 from to ...
vision Downloading MNIST dataset with torchvision gives HTTP Error 403
@eduardo4jesus You could patch your model script at the top using: It will use that user agent for t...
pytorch CycleGAN and pix2pix any suggestion on how to get rid of the checkered effect
@AllAwake Cool results! Here is the implementation of resize-conv I used It remove the checkerboard ...
opencv opencv3.10 does not support cuda8.0rc?
For those people who find this page looking for a way to fix this in their build but can't deal with...
opencv Cannot make install opencv from origin/master on ubuntu 17.10
@zapcity @Guilmort you may have to manually execute the generator script ( Assuming you call...
vision New Pillow version (7.0.0) breaks torchvision (ImportError: cannot import name 'PILLOW_VERSION' from 'PIL')
Until the new torchvision release is out the workaround is either to use the master version of torch...
opencv cv2.rectangle() TypeError: an integer is required (got type tuple)
The error message is completely wrong as always I think the cause of this error may be the case when...
vision Failed in fine-tuning inception_v3
@jamiechoi1995 @MichaelLiang12 @TiRune is correct inception_v3 has an aux branch ...
loam_velodyne loam_velodyne failed
You can try removing the line: loam_velodyne/CMakeLists.txt Line 35 in 25db5dd add_definitions( -mar...
librealsense Installing pyrealsense2 on MacOS?
Okay I got it Required Info Camera Model { D435 } Operating System & Version {MacOS Catalina } Issue...
openpose How hard would it be to port to mobile? (iOS/Android)
I'm trying to convert the .caffemodel to CoreML to see if I can run it on iOS 11 I will report more ...
librealsense module 'pyrealsense2' has no attribute 'pipeline'
For me I hade to do import pyrealsense2.pyrealsense2 as rs I apologize I wasn't active here for a lo...
facenet triplet training did not converged
Hi @davidsandberg I chose these parameters carefully and run a new experiment (20 days) The result i...
vision pyinstaller interaction with torchvision
Here are the workarounds I found to make things work Solution 1: patch torchvision 0.2.2 (dirty and ...
carla Invalid pixelmap or window parameter
@jbeck9 I actually got this working by switching to the latest Nvidia driver 470 and running Carla w...
facenet error when running Validate_on_lfw
@farimani thank you~ I am new to the machine learning @davidsandberg I am trying to run the (Validat...
facenet Error loading a frozen graph ( float incompatible with float_ref )
my code I froze the 20170131-234652 model using the but I cannot load it in C++ I fi...
opencv Incorrect error message for non-integer points in rectangle draw function: TypeError: function takes exactly 4 arguments (2 given)
I got the same issue I resolved it by converting all the coordinate of the bounding box into int ins...
opencv GCC 6.0/6.x build problems
This workaround works in some cases (see #6541): cmake -DENABLE_PRECOMPILED_HEADERS=OFF ... ...
openpose Python API error: Cannot import name pyopenpose
My environment - UBUNTU 18.04 CUDA 9.2 CUDNN 7.2.1 Openpose current version 1.4 (Jan 2019) I did the...
librealsense IMU data stream (Python)
Hi @tRosenflanz Many thanks for your suggestion I wrote the following script that can perhaps be mad...
openpose CMake Error at CMakeLists.txt:929 (add_subdirectory):
Temporary workaround Clone pybind11 separately into the folder The configure generate and build all ...
openpose macOS - protobuf compilation errors
@soulslicer installing Caffe separately and setting BUILD_CAFFE to false in the cmake config seems t...
opencv BUG:TypeError: Expected Ptr<cv::UMat> for argument 'img'
Somehow img = np.array(img) still doesn't work for me but img = img.copy() works. ...
scikit image Getting "ImportError: DLL load failed: The specified module could not be found."
Very likely the C++ runtime library is missing As a workaround try to install the Microsoft Visual C...
FCOS How to train my own datasets (format is like coco datasets)
@EDG-Zola You do not need to change this code In order to train FCOS on your own dataset you need to...
gluon cv OSError: cannot open shared object file: No such file or directory
make sure you cuda version is 9.0 And add below to ~/.bashrc run Add below to /etc/
opencv ‘memcpy’ was not declared in this scope (Ubuntu 16.04)
Simple replace in opencv/cmake/OpencvDetectCuda.cmake to it's work for me! Please state the informat...
vision Origin of the means and stds used for preprocessing?
You need to go deeper ;)
javacv Duplicated files copied in APK
This worked for me with gradle:2.0.0 ... After updating to gradle 2.10 I started getting the followi...
facenet pre-trained model unable to load because of tensorflow saver format :(
Hi I'm not sure which file you are trying to load I recently tried loading a pretrained model with t...
pcl Mojave Xcode 10.1; pcl 1.8 make: cmath: no member named isinf
I encounter this problem too Problem The system uses a wrong toolchain path Hi I want to build and i...
crnn The issue of creating a dataset with with python3.5
In python3 the text (str) and bytes can no longer be used in the same way The function txn.put(...) ...
mediapipe How do you use MediaPipe on the web in your own web app?
We will be releasing MP solutions Javascript API during week of 9 Dec. I don't need the visualizer I...
pytorch CycleGAN and pix2pix Error(s) in loading state_dict for ResnetGenerator
I've had similar issue while trying to test CycleGAN (--model test) on my own dataset Default --norm...
dlib ImportError: cannot open shared object file
pip install mkl it works to me I have installed dlib using pip install dlib but ...
mediapipe Accessing landmarks, tracking multiple hands, and enabling depth on desktop
I created a gist showing how to do this for retrieve hand landmarks (Based on @mgyong example ...
mAP Is there any way to calculate log-average miss rate?
@ZHANGHeng19931123 @nguyendu392 Done! You will now find a plot in the results/ with the log-average ...
dlib detector too slow on the TK1 board
My test code and compiler settings are here Updated RPI3 measurements: Raspberry Pi 3 Model B [rev ...
opencv Undefined reference to __atomic_xxx
@MKK-a try this workaround: System information (version) OpenCV => 4.1.1 OS => Raspbian Buster (Debi...
opencv I am having problems trying to build opencv-3.2.0 using the text module from opencv-contrib-3.2.0
I found bug is completely related to opencv and opencv_contrib branch System information (version) O...
opencv Error from STL library while compiling for Android with ANDROID_STL=c++_static(shared)
Android NDK provides own CMake toolchain file since r15 So solution is very simple - use it instead ...
cvat Unable to remote connect
To help anyone out there with complete solution: Create in cvat home directory file docker-compose.o...
pytorch CycleGAN and pix2pix Any idea about dealing with large image size ?
It's possible to run CycleGAN on 1024p images The model is fully convolutional This means that even ...
opencv FaceRecognizer missing documentation for Python
@LinHtetPaing do the following sudo pip3 install opencv-contrib-python and if you were using cv2.fac...
mediapipe Set up iris landmark in python solution
@fredrikmalmberg @Egorovlvan Hi! I had the same issue so I had to review @jiuqiant 's git diff ...
opencv cv2.imshow() freezes
maybe cv2.waitKey(0) waits for a key stroke what about cv2.waitKey(1) When I call for imshow() from ...
vision [feature request] ROI Pooling layers
Check out #708 @fmassa plans to merge layers for v3 Let's hope the next release is pushed out soon. ...
crnn Compilation error with the current TH++
I solved it by downgrading fblualib (commit: bdcf94bb835c41b5d822371fb6f7b75c1d53efbc) and thpp (com...