Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. [solved] trouble linking libtiff with vc++
Forum Update on Tuesday, May 27th 2025

[solved] trouble linking libtiff with vc++

Scheduled Pinned Locked Moved 3rd Party Software
5 Posts 2 Posters 3.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    katz0r
    wrote on 8 Oct 2013, 17:57 last edited by
    #1

    Dear Qt Fans,

    I am trying to link libtiff to a Qt Project using QtCreator and the compiler from Visual Studio 2012, 64bit. Libtiff compiled just fine using the supplied makefile.vc

    The arguments in the .pro file are

    @INCLUDEPATH = -I"..\tiff-4.0.3\libtiff" -I"..\tiff-4.0.3\port"
    LIBS += -L"..\tiff-4.0.3\libtiff" # ..\tiff-4.0.3\port\libport.lib ..\tiff-4.0.3\libtiff\libtiff.lib ..\tiff-4.0.3\libtiff\libtiff_i.lib@

    and the linker seems to find the corresponding .lib files. Yet, the linker cant resolve "TIFFOpen" "TIFFClose" "TIFFWriteScanline" "TIFFSetField" external symbols.
    I can however, find the symbols in the lib file. dumpbin yields

    @ 010 00000170 SECT5 notype () External | _TIFFClose
    ...
    008 00000000 SECT3 notype Static | ?module@?1??TIFFOpen@@9@9 (TIFFOpen'::2'::module)
    00D 0000000C SECT3 notype Static | ?module@?1??TIFFOpenW@@9@9 (TIFFOpenW'::2'::module)
    ...
    034 000000C0 SECT5 notype () External | _TIFFOpen
    035 000001B0 SECT5 notype () External | _TIFFOpenW@

    I suspect that some build argument for Qt is different so the name mangling schemes are not compatible. What are your ideas? I have read something about wchar_t being a native type or not. Or could it be static vs dynamic linking?

    thanks!
    Martin

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 8 Oct 2013, 20:26 last edited by
      #2

      Hi,

      Out of curiosity, why do you need to link against libtiff ? Tiff support is already implemented in Qt

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • K Offline
        K Offline
        katz0r
        wrote on 11 Oct 2013, 07:24 last edited by
        #3

        Hi, thanks for the answer!

        Yes, tiff is supported by Qt, but i need to save data with 16bit per sample. I think thats not possible with the built in tiff routines. (I'd be glad to be corrected here)

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 11 Oct 2013, 11:55 last edited by
          #4

          AFAIK you're correct about the 16bit.

          One trick that you could use is to include the tiff.pri from Qt's sources in your project so it will be built/linked with your code. Not the most economic way but so you are sure to have a working libtiff on windows (and no need to install another one)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • K Offline
            K Offline
            katz0r
            wrote on 6 Nov 2013, 09:11 last edited by
            #5

            Dear SGaist,

            thanks for the hint, it worked! libtiff.pri produces the tiff_* objs in the build directory and links without problems.

            Sorry for the late reply, I didnt get back to this earlier.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved