You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a C++ library for which I'm using pybind11 to generate Python bindings. Currently I'm compiling on Linux x86 host for the same target using gcc and everything works fine.
I want to port my library (which only depends on C ++ std libraries) to Windows and I was to keep my current Linux development environment and cross compile the library for Windows using MinGW (from MXE). However when I try to build the python bindings using pybind11, the compilation fails as MinGW cannot find a compatible Python library.
My question is as follows:
Has anyone else had a similar issue and if so is there a workaround. I tried compiling CPython using MinGW but it seems quite tedious and not well supported by current Python versions (> 3.9)
Is there a way that pybind11 generated module does not link to Python at all (I could just provide the necessary header files) But at runtime (i.e. when a python script that imports the module gets interpreted), it automatically loads the Python DLL (the one that ships with Python and was most probably compiled with MSVC). If this works I could just distribute by python module along with a compatible Python DLL
If there is a 3rd option I would be most welcome as well (N.B. I cannot compile on Windows and I need to keep my a cross compilation environment (not necessarily MXE)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a C++ library for which I'm using pybind11 to generate Python bindings. Currently I'm compiling on Linux x86 host for the same target using gcc and everything works fine.
I want to port my library (which only depends on C ++ std libraries) to Windows and I was to keep my current Linux development environment and cross compile the library for Windows using MinGW (from MXE). However when I try to build the python bindings using pybind11, the compilation fails as MinGW cannot find a compatible Python library.
My question is as follows:
If there is a 3rd option I would be most welcome as well (N.B. I cannot compile on Windows and I need to keep my a cross compilation environment (not necessarily MXE)
Beta Was this translation helpful? Give feedback.
All reactions