2016.07.13 22:07 "[Tiff] Visual Studio 2012: snprintf problem when linking with libtiff.lib", by Bart Vandewoestyne

2016.07.13 23:40 "Re: [Tiff] Visual Studio 2012: snprintf problem when linking with libtiff.lib", by Bart Vandewoestyne

On 2016-07-14 00:47, Bob Friesenhahn wrote:

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 corresponding code in my LibTIFF 4.0.6 looks like this:

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

#define snprintf _snprintf
#endif

and I am using Visual Studio 2012 (_MSC_VER == 1700). If my reasoning is correct, the above would not make a difference for me, but would only make a difference from Visual Studio 2015 on (_MSC_VER == 1900)...

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.

Are you saying that in this case, next to linking with libtiff.lib, it is indeed necessary to also link with libport.lib (as I was guessing)?

Oh, and by the way: how is 'not sufficient' defined for the MSVC runtime? When do we fallback to _TIFF_snprintf_f()?

Kind regards,
Bart