AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2016.07.13 22:07 "[Tiff] Visual Studio 2012: snprintf problem when linking with libtiff.lib", by Bart Vandewoestyne
2016.07.13 22:47 "Re: [Tiff] Visual Studio 2012: snprintf problem when linking with libtiff.lib", by Bob Friesenhahn
2016.07.13 23:40 "Re: [Tiff] Visual Studio 2012: snprintf problem when linking with libtiff.lib", by Bart Vandewoestyne
2016.07.14 13:20 "Re: [Tiff] Visual Studio 2012: snprintf problem when linking with libtiff.lib", by Bob Friesenhahn

2016.07.13 22:47 "Re: [Tiff] Visual Studio 2012: snprintf problem when linking with libtiff.lib", by Bob Friesenhahn

Hello list,

I am building LibTIFF 4.0.6 with Visual Studio 2012, using the nmake approach from http://www.remotesensing.org/libtiff/build.html#PC. I now try to link my own program with libtiff by making sure that libtiff.lib is found at link time. However, I get the error:

libtiff.lib(tif_dirinfo.obj): error LNK2019: unresolved external symbol __TIFF_snprintf_f referenced in function __TIFFCreateAnonField

Fix libtiff/tif_config.vc.h so that its snprintf-related bits look like:

/* Visual Studio 2015 / VC 14 / MSVC 19.00 finally has snprintf() */ #if defined(_MSC_VER) && _MSC_VER < 1900

#define snprintf _snprintf
#else
#define HAVE_SNPRINTF 1
#endif

There is a fix in libtiff CVS which is supposed to fix the problem.

The source file port/snprintf.c is supposed to provide a snprintf replacement (_TIFF_snprintf_f()) when the MSVC runtime is not sufficient. This means it needs to be included in the build.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/