0

I am currently trying to install python bindings for a project build in Rust (https://github.com/bet4it/udbserver). Building the project itself works fine and I get a .dll, .h and .lib file. Since I am on Windows I can not just put them into usr\bin - usr\include - usr\lib respectively but I included the paths of the .lib and .h file in the include and library directories that can be specified in the python setuptools, which is used by the project to generate the python bindings. When I try to execute the setup python file I get linker errors that look like this:

"udbserver.obj : error LNK2001: unresolved external symbol __imp__PyObject_GetAttr

udbserver.obj : error LNK2001: unresolved external symbol __imp__Py_NoneStruct

udbserver.obj : error LNK2001: unresolved external symbol __imp__Py_Initialize

udbserver.obj : error LNK2001: unresolved external symbol __imp__PyModule_Create2

udbserver.obj : error LNK2001: unresolved external symbol _udbserver

udbserver.obj : error LNK2001: unresolved external symbol __imp__PyLong_AsVoidPtr

udbserver.obj : error LNK2001: unresolved external symbol __imp__PyUnicode_FromString

udbserver.obj : error LNK2001: unresolved external symbol __imp__PyArg_ParseTuple

build\lib.win32-cpython-311\udbserver.cp311-win_amd64.pyd : fatal error LNK1120: 8 unresolved externals"

I thought that maybe the Python include and library files are missing in the library and include directories but when executing setup it shows that the python\lib and python folder are included in the library paths and python\include and python\Include are included in the include paths. So I am kind of puzzled as to why this is happening.

What other options do I have? Try to create the bindings myself?

Edit: By using 32bit Python I was able to eliminate all linker errors but one. Which is the one mentioned the unresolved external "_udbserver". Still unsure about this one.

0 Answers0