0

I am trying to write an application that saves 16 bit tiffs. I use QT Creator and the QT API, but can't use the QT tiff features because of the 16 bit need. My application needs to work in both Windows and Linux.

The Linux version works fine. When I try and link in Visual C++/Win 7, I get the following error messages:

FrameSaveRunnable.obj : error LNK2019: unresolved external symbol __imp_TIFFClose referenced in function "protected: virtual void __cdecl FrameSaveRunnable::run(void)" (?run@FrameSaveRunnable@@MEAAXXZ)
FrameSaveRunnable.obj : error LNK2019: unresolved external symbol __imp_TIFFSetField referenced in function "protected: virtual void __cdecl FrameSaveRunnable::run(void)" (?run@FrameSaveRunnable@@MEAAXXZ)
FrameSaveRunnable.obj : error LNK2019: unresolved external symbol __imp_TIFFWriteScanline referenced in function "protected: virtual void __cdecl FrameSaveRunnable::run(void)" (?run@FrameSaveRunnable@@MEAAXXZ)
FrameSaveRunnable.obj : error LNK2019: unresolved external symbol __imp_TIFFOpen referenced in function "protected: virtual void __cdecl FrameSaveRunnable::run(void)" (?run@FrameSaveRunnable@@MEAAXXZ)
debug\avtcam.exe : fatal error LNK1120: 4 unresolved externals

The relevant parts of my .pro file look like this:

INCLUDEPATH += "C:\Program Files (x86)\GnuWin32\include"
LIBS += -L"C:\Program Files (x86)\GnuWin32\lib" -llibtiff

I have googled and searched all over, and it seems that the problem has to do with C/C++ name incompatabilities. There are some suggestions as to how to fix it inside of Visual Studio, but I am working in the QT environment, and dont use VS at all--just the compiler. Is there an answer to this problem?

My environment: QT 5.4.0, Visual Studio 12, win 7 Pro, libtiff binaries downloaded from http://gnuwin32.sourceforge.net/packages/tiff.htm

LogicStuff
  • 19,397
  • 6
  • 54
  • 74
jhowland
  • 365
  • 1
  • 5
  • 19

1 Answers1

0

You need libtiff compiled for MSVC. MSVC is the significant part of your environment, not Qt.

See http://www.remotesensing.org/libtiff/build.html#PC for instructions for building it (though I'm not sure if those are up to date), or there are other answers on stackoverflow on how to do it (eg Installing LibTiff to Visual Studio 2010).

Community
  • 1
  • 1
Hamish Moffatt
  • 826
  • 4
  • 12
  • I successfully built libtiff under MSVC following the instructions and it changed the problem, but I still cannot link with the libtiff functions--now I get the following: FrameSaveRunnable.obj : error LNK2019: unresolved external symbol TIFFWriteScanline referenced in function "protected: virtual void __cdecl FrameSaveRunnable::run(void)" (?run@FrameSaveRunnable@@MEAAXXZ) – jhowland Apr 23 '15 at 15:00