boostorg / dll

Library for comfortable work with DLL and DSO
https://boost.org/libs/dll
52 stars 43 forks source link

Compatibility with pybind11? #44

Closed danzimmerman closed 4 years ago

danzimmerman commented 4 years ago

I've got a library compiled to a DLL that works properly in C++ when loaded with boost::dll.

I'd like to load the same binary in Python using pybind11, which works fine by itself. However, the DLL compiled with a PYBIND11_MODULE in addition to a BOOST_DLL_ALIAS fails to load in C++ with boost::dll.

Throws boost::dll::shared_library::load() failed: The specified module could not be found.

The library is for use from C++ but needs some complex functional testing against Python prototype code. It's convenient to imagine a dual-use Python/C++ DLL that has both interfaces in a single binary build.

But maybe this isn't possible?

I've put a detailed description in this gist.

danzimmerman commented 4 years ago

Minimal-ish example here:

https://github.com/danzimmerman/pybind-boostdll-minimal

danzimmerman commented 4 years ago

Not a boost issue at all... needs python DLL to run in C++. Sorry for the noise.