Tag Archives: COLMAP Install Error

COLMAP Install Error: Undefined reference to libtiff4.0 [Solved]

At Ubuntu 20 When installing colmap under 04 system, run under /colmap/build folder

make -j

The following errors are reported:

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFReadEncodedStrip@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFReadEXIFDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFFieldReadCount@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFSetTagExtender@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFCurrentDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFReadTile@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFSetDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFClientOpen@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFSetField@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFScanlineSize@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFWriteDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFTileRowSize@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFWriteScanline@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFGetFieldDefaulted@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFReadDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFIsTiled@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFFieldDataType@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFSwabArrayOfLong@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFMergeFieldInfo@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFLastDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `_TIFFDataSize@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFSetSubDirectory@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFFieldPassCount@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFFieldWithTag@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFReadRGBAImage@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFClose@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFGetTagListCount@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFDefaultStripSize@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFFieldTag@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFGetTagListEntry@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFComputeStrip@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFDataWidth@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFFieldName@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFIsByteSwapped@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFGetField@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: undefined reference to `TIFFTileSize@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfreeimage.so: 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

Conduct in-depth investigation and find that there is a Warning in the previous cmake…:

runtime library [libgmp.so.10] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /home/damon/anaconda2/lib

It turns out that anaconda’s Qt is used, so add the following fields to Cmakelist.txt in the colmap folder to force the switch to system Qt

SET(CMAKE_PREFIX_PATH "/usr/lib/x86_64-linux-gnu/cmake")

Re-execute make – j and it will be OK!

Note: If you have previously made and failed, you need to delete all the files in the build folder and then make -j again, otherwise it will still fail