MantisBT - VTK
View Issue Details
0015535VTK(No Category)public2015-06-11 13:212016-07-06 11:21
dkuegler 
 
normalminorhave not tried
closedfixed 
6.0.0 
 
TBD
incorrect functionality
0015535: Visual Studio 2015 Compilation Errors
Similar to 0015534

I encountered the error

Severity Code Description Project File Line
Error C2375 'lfind': redefinition; different linkage vtktiff C:\Program Files (x86)\Windows Kits\10\Include\10.0.10056.0\ucrt\corecrt_search.h 191

From tiffiop.h of Project vtktiff (ThirdParty/tiff/vtktiff/)

#ifdef HAVE_SEARCH_H
# include <search.h>
#else
extern void *lfind(const void *, const void *, size_t *, size_t,
                   int (*)(const void *, const void *));
#endif

Solution according to the header of corecrt_search.h:
Define HAVE_SEARCH_H

Why is this an issue?
Because search.h included through stdlib.h before.

This would be the only reference to HAVE_SEARCH_H, that I could find.
No tags attached.
related to 0015534closed Sean McBride Visual Studio 2015 Compilation Errors 
Issue History
2015-06-11 13:21dkueglerNew Issue
2015-06-11 13:48dkueglerNote Added: 0034537
2015-07-08 05:48dkueglerNote Added: 0034690
2015-08-28 08:28T.J. CoronaRelationship addedrelated to 0015534
2016-07-06 11:21Sean McBrideNote Added: 0036177
2016-07-06 11:21Sean McBrideStatusbacklog => closed
2016-07-06 11:21Sean McBrideResolutionopen => fixed

Notes
(0034537)
dkuegler   
2015-06-11 13:48   
Another similar issue is found according to

Severity Code Description Project File Line
Error C1189 #error: Macro definition of snprintf conflicts with Standard Library function declaration vtklibxml2 C:\Program Files (x86)\Windows Kits\10\Include\10.0.10056.0\ucrt\stdio.h 1927

VS claims the definitio in stdio.h collides with the definition in condig.h

From config.h
/* Win32 Std C name mangling work-around */
#if defined(_MSC_VER)
# define snprintf _snprintf
#endif

I do not quite understand this, but I expect it has changed somewhere similar to
/* Win32 Std C name mangling work-around */
#if defined(_MSC_VER) && (_MSC_VER < 1500)
# define vsnprintf _vsnprintf
#endif

and thus it should really be (_MSC_VER is 1900 for me)
#if defined(_MSC_VER) && (_MSC_VER < 1900)
# define snprintf _snprintf
#endif

That would be in (ThirdParty/libxml2/vtklibxml2/config_cmake.h.in)
(0034690)
dkuegler   
2015-07-08 05:48   
See https://gitlab.kitware.com/vtk/vtk/merge_requests/311 [^]
(0036177)
Sean McBride   
2016-07-06 11:21   
Looks like this was fixed and merged. Setting to closed.