Which LibTIFF to use?
We are building Qt 4.8.7 ourselves (and cannot upgrade to 5.X yet), and during the configure step, one has the options
-no-libtiff ........ Do not compile TIFF support. -qt-libtiff ........ Use the libtiff bundled with Qt. + -system-libtiff .... Use libtiff from the operating system. See http://www.libtiff.org
src\3rdparty\libtiff\VERSIONI learn that the LibTIFF version that comes with Qt 4.8.7 is LibTIFF 4.0.3 from 22 september 2012. From http://www.simplesystems.org/libtiff/ I learn that the latest version is 4.0.7.
I am wondering what are the reasons for choosing either
-system-libtiff(which appears to be the default). The only reason I can think of for prefering
-qt-libtiffis that it allows to use a more recent version of LibTIFF.
What could be reasons for choosing either
-system-libtiff? What are the advantages or disadvantages for a particular choice?
It allows to build the tiff plugin on platforms that don't provide libtiff natively like Windows.
Hmm... I am rather confused now :-) With Qt 4.8.7 comes LibTIFF 4.0.3 (under
src\3rdparty\libtiff). If I use
-qt-libtiff, then if I understand things correctly, it will compile thát LibTIFF to a plugin. But what if I want to use my own build of a later version of LibTIFF (say 4.0.7)? Is that what
-system-libtiffis for? If 'yes', then how does Qt know where my own compiled LibTiff 4.0.7 is located?
You can use the
-Loptions to pass the path to your custom build of libtiff.
Ok. Thanks. That makes sense. However, my original question remains: are there any reasons for preferring
-qt-libtiff? The only one that I can think of is the ability to use a more recent version of LibTIFF.
That's the usual yes.
And beside more recent version, there are also the security fixes that may be delivered by distributions.
Thanks for confirming.
And now that we have talked about the advantages of using
-system-libtiff, maybe we should also discuss the possible disadvantages? ;-)
For example, I can imagine that things do not always work as expected when using a more recent LibTIFF version than the one that comes bundled with Qt? This blog post advises against using -system-libtiff because "sometime images cannot be correctly displayed" and refers to QTBUG-11453 which is about the very similar
If anyone else experienced similar problems when using their own build of LibTIFF, i would be happy to hear!
@SGaist While looking at how we configure and build our Qt 4.8.7 right now, i see not libtiff-related configure options, which means that the default
-system-libtiffis used. However, we are building on Windows and do not specify any
-Loptions. So I am wondering whether the Qt build actually finds a LibTIFF library, and if this is the case, which one is used. Any ideas on how to check that?
For the record: in our Qt-install directory, there are files like
-qt-libtiffif no system libtiff is found?
If you don't pass anything the configure script will try to use the system library and if it fails to find it fallback to its own version. If you take a look at the output of
configure --helpyou'll see the defaults the configure script will try to use.
If you don't pass anything the configure script will try to use the system library and if it fails to find it fallback to its own version.
I just checked this. We are not passing anything TIFF-related to the configure script, which means that we are using the default
-system-libtiff. However, it looks like our system TIFF library is not found, since I noticed that the code under
QT_SRC_ROOT\src\3rdparty\libtiffdoes gets built. I checked that by introducing a syntax error in
src\3rdparty\libtiff\libtiff\tif_print.cand then noticing that our Qt build failed when compiling the 3rdparty libtiff project.
For as far as I understand it now, I will have to use
-system-libtiffwith the correct
-Loptions to really make sure we are using our own build of the TIFF library. I will try that and report my findings. Stay tuned! ;-)
Where is your system libtiff located ?
Where is your system libtiff located ?
We are building on a Windows 7 system using VS2012 and compile LibTIFF ourselves. The header files are in
D:\some\path\to\libtiffand the debug and release
.libfiles are in
D:\some\path\to\libtiff\vc11. I assume these directories are the ones to use with the
-system-libtiff? (I still haven't found time to try that out, I will report later)
AFAIK, Windows doesn't have any system libtiff.