-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
building on MSYS2 MINGW64 #1168
Comments
Having a bit of a stab in the dark with setup.py -import sys, os, re, shlex
+import sys, os, re, shlex, sysconfig
...
except ValueError:
pass
- if os.name == 'nt':
+ if 'mingw' in sysconfig.get_platform():
+ # Windows mingw
+ settings['extra_compile_args'].extend([
+ '-Wno-write-strings',
+ '-Wno-deprecated-declarations',
+ ])
+ settings['libraries'].append('odbc32')
+
+ elif os.name == 'nt':
settings['extra_compile_args'].extend([
'/Wall', I get a little further:
|
mkleehammer/pyodbc/mkleehammer#1168
mkleehammer/pyodbc/mkleehammer#1168
mkleehammer/pyodbc/mkleehammer#1168
mkleehammer/pyodbc/mkleehammer#1168
mkleehammer/pyodbc/mkleehammer#1168
For future reference... Out of curiosity I thought I'd check Cygwin, it appears pyodbc does not install in Cygwin as it currently stands. There seems to be 2 possible workarounds: Line 310 in 12fe42e
e.g. something like this would work: + #ifdef SQL_OV_ODBC3_80
PyObject* odbcversion = PyObject_GetAttrString(pModule, "odbcversion");
if (PyUnicode_CompareWithASCIIString(odbcversion, "3.8") == 0)
{
defaultVersion = (SQLPOINTER)SQL_OV_ODBC3_80;
}
}
Py_DECREF(odbcversion);
+ #endif Seems Cygwin as supplied has a header file that defines SQL_OV_ODBC3 but not SQL_OV_ODBC3_80. (MSYS2 is the same). Lines 48 to 50 in 12fe42e
to avoid error: /usr/include/w32api/wtypesbase.h:101:15: note: previous declaration as ‘typedef unsigned int ULONG’
I did not test either approach beyond checking |
Can't seem to get build to work on mingw (from looking at other issues seems cygwin is working), I note some old references to MING32 in the source (e.g. in
src/pyodbc.h
) but it seemssetup.py
does not account for mingw. Hence the below error (with windows compiler flags).The text was updated successfully, but these errors were encountered: