I have a dll written in C ++ that I want to export to Python to run regression and unit testing (just to simplify support and run regression with Python). For this, I want to use Boost.Python to export the main DLL API so that it can be used in Python. My builds are as follows:
- MyLibrary.dll // main C ++ API library
- MyLibrary.pyd // thin DLL project containing only
BOOST_PYTHON_MODULE export BOOST_PYTHON_MODULE (depending on MyLibrary.dll) - ... // other C ++ DLL files that MyLibrary.dll depend on
I had problems connecting MyLibrary.pyd, but after you sorted out the issues a bit (for example, here ), I realized that I needed to rebuild boost by pointing b2.exe to my specific version of Python. After that, I was able to import and run my library from python (only on my machine ).
Technical data: I build libraries with boost 1.51, Python 3.23 on Windows 7 x64 and MSVC-10.0 (my own projects are built from VS2010). The option that I use to communicate with boost is shared libraries, a 64-address model, release accordingly with my own builds.
The problem is that when I try to import a library (built on my machine) on another machine, python complains:
ImportError: DLL load failed: The specified procedure could not be found.
In the line import MyLibrary
Which raises the following questions:
- I created MyLibrary.pyd on my python-portable machine? Sense, will it work with other versions of Python besides 3.23 (the version that I used to build boost.python with my machine)?
- Does MyLibrary.pyd user need to rebuild boost with his own python version in order to be able to import it successfully?
- So far, we have used the preinstalled installation accelerator for windows supplied by BoostPro. What version of Python is related to the assembly, and can I save my users a headache when creating boost myself, if we just decide to work with the "correct" version of Python throughout the team (version related to BoostPro)?
source share