Open RoDuth opened 1 year ago
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:
$ python setup.py build
WARNING: '' not a valid package name; please use only .-separated package names in setup.py
running build
running build_py
running build_ext
building 'pyodbc' extension
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -O3 -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-
D_FORTIFY_SOURCE=2 -fstack-protector-strong -O3 -DPYODBC_VERSION=4.0.36b17 -IC:/msys64/mingw64/include/python3.10 -c src/buffer.cpp -o build/temp.mingw_x86_64-3.10/src/buffer.o -Wno-write-strings -Wno-deprecated-declar
ations
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -O3 -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-
D_FORTIFY_SOURCE=2 -fstack-protector-strong -O3 -DPYODBC_VERSION=4.0.36b17 -IC:/msys64/mingw64/include/python3.10 -c src/cnxninfo.cpp -o build/temp.mingw_x86_64-3.10/src/cnxninfo.o -Wno-write-strings -Wno-deprecated-de
clarations
In file included from src/cnxninfo.cpp:8:
src/wrapper.h: In destructor 'RegKey::~RegKey()':
src/wrapper.h:114:13: error: 'RegCloseKey' was not declared in this scope
114 | RegCloseKey(hkey);
| ^~~~~~~~~~~
error: command 'C:\\msys64\\mingw64\\bin/gcc.exe' failed with exit code 1
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).