Hello All,

I need to read some TIFF using the libtiff in Windows.
I have just build the libtiff and I have my .lib files correctly in a folder.
Then I used the QtCreator Add Library function to add the library to my project and this is the result:

Qt Code:
  1. #-------------------------------------------------
  2. #
  3. # Project created by QtCreator 2014-09-02T10:15:41
  4. #
  5. #-------------------------------------------------
  6.  
  7. QT += core
  8.  
  9. QT -= gui
  10.  
  11. TARGET = PruebaLibTiff
  12. CONFIG += console
  13. CONFIG -= app_bundle
  14.  
  15. TEMPLATE = app
  16.  
  17.  
  18. SOURCES += main.cpp
  19.  
  20.  
  21. win32:CONFIG(release, debug|release): LIBS += -L$$PWD/libtiff/.libs/ -ltiff
  22. #else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/libtiff/.libs/ -ltiffd
  23. #else:unix: LIBS += -L$$PWD/libtiff/.libs/ -ltiff
  24.  
  25. INCLUDEPATH += $$PWD/libtiff/.libs
  26. DEPENDPATH += $$PWD/libtiff/.libs
  27.  
  28. win32:CONFIG(release, debug|release): LIBS += -L$$PWD/libtiff/.libs/ -ltiffxx
  29. #else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/libtiff/.libs/ -ltiffxxd
  30. #else:unix: LIBS += -L$$PWD/libtiff/.libs/ -ltiffxx
  31.  
  32. INCLUDEPATH += $$PWD/libtiff/.libs
  33. DEPENDPATH += $$PWD/libtiff/.libs
To copy to clipboard, switch view to plain text mode 

I have commented the debug and unix versions of the includes.

Then, this is my main file:

Qt Code:
  1. #include <QCoreApplication>
  2. #include <QDebug>
  3. #include <inttypes.h>
  4. #include "C:/Qt/Programas/PruebaLibTiff/libtiff/tiffio.h"
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. QCoreApplication a(argc, argv);
  9.  
  10. TIFF *tif;
  11. tif = TIFFOpen("MARBLES.TIF", "r");
  12.  
  13. return a.exec();
  14. }
To copy to clipboard, switch view to plain text mode 

But when I compile and run, I keep getting the "undefined reference to TIFFOpen" error.

Could you help me? What am I doing wrong.

If I use the Ctrl-Space command in Qt, I can see all the TIFF functions, including TIFFOpen. Why cant I compile then?

Thanks!