virtuoso-python icon indicating copy to clipboard operation
virtuoso-python copied to clipboard

pyodbc v4-virtuoso build error

Open danizen opened this issue 7 years ago • 2 comments

On Windows 7 with Microsoft Visual Studio 2015 and Python 3.5.1, I have these build errors out of the box:

src\virtuoso.cpp(17): error C3861: 'strncasecmp': identifier not found
src\virtuoso.cpp(54): error C3861: 'wcsncasecmp': identifier not found
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\amd64\\cl.exe' failed with exit status 2

I observe that in src\pyodbc.h, there is a macro defined for strcasecmp when _MSC_VER is not defined. Going the other way to avoid impacts on upstream, I added the following to src\virtuoso.h:

#ifdef _MSC_VER
#  define strcasecmp _stricmp
#  define strncasecmp _strnicmp
#endif

This leaves wcsncasecmp - I cannot figure out easily from Dr. Google how this should be solved, especially as wchar_t is only 16-bits on windows. I will do my development in vagrant or on a server, and I suspect this will work, but I will want eventually to be able to do this from Windows as well - most of the developers here work from Windows, and I'm an exception in being able to use vagrant (and also dabble in C/C++ even though I don't write in it any longer).

danizen avatar Nov 21 '17 17:11 danizen

On Windows, maybe you can use '_strnicmp' and '_wcsnicmp', which may work.

xjtusedy avatar Apr 04 '19 14:04 xjtusedy

@xjtusedy , I think I already succeeded in building it by changing the tests on MSC_VER to build it, or maybe that was another package. In any case, I think I'm good now.

danizen avatar Apr 05 '19 03:04 danizen