2013.10.08 13:05 "[Tiff] trouble linking libtiff with msvc++ 2012", by Schmeißer, _Martin
Dear libtiff users,
May I solicit some help regarding the linking of libtiff:
I am trying to link libtiff to a c++ project using Qt and the compiler from Visual Studio 2012, 64bit. Libtiff compiled just fine using the supplied makefile.vc
The compiler and linker arguments in the makefile (qmake generated) are
INCPATH = -I"..\tiff-4.0.3\libtiff" -I"..\tiff-4.0.3\port"
LINKER = link
LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'"
LIBS = qtmain.lib ..\tiff-4.0.3\port\libport.lib ..\tiff-4.0.3\libtiff\libtiff.lib
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
and so on.
I am including "libtiff.h".
How does the c++ compiler find the extern "c" symbols? Is the leading underscore the problem?
thanks!
Martin
________________________________
Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.
Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph
Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking
Sitz Berlin, AG Charlottenburg, 89 HRB 5583
Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin
http://www.helmholtz-berlin.de