Results 1 to 2 of 2

Thread: Help linking LibTiff

  1. #1
    Join Date
    Nov 2009
    Posts
    29
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Help linking LibTiff

    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!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Help linking LibTiff

    Just a side note -- you are aware Qt can open TIFF files using one of its plugins, right?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 3
    Last Post: 7th February 2012, 10:40
  2. Qt program with libtiff functions
    By dulan2010 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 12th July 2011, 10:58
  3. Linking With Qt VS Add in
    By rcjohns in forum Newbie
    Replies: 2
    Last Post: 14th March 2010, 12:42
  4. libtiff plugin ld errors
    By jeffpogo in forum Qt Programming
    Replies: 1
    Last Post: 19th May 2009, 22:07
  5. Qt/Mac Configuring with libTiff ?
    By nareshqt in forum Installation and Deployment
    Replies: 0
    Last Post: 11th June 2008, 12:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.