I'm currently working on a 32-bit C++ DLL in Visual Studio 2022 which uses boost::python to embed Python code. For my builds I use the include and lib directories from a full installation of 32-bit Python on my machine, as the Python embeddable package doesn't ship with these header or lib files. However when actually running I want it to use the interpreter in the embeddable package. I think this should be as simple as getting it to open the Python312.dll file from inside the embeddable package directory, however I can't figure ou how to make it not prefer the DLL from the full python installation on my PATH. I have tried explicitly loading the DLL with LoadLibrary, but I think boost::python is already implicitly linked with the other DLL which takes precedence. Is there something I'm missing here? Please let me know if you need any more information, thanks.
-
It’s from a .EXE context? You may need to set the path to your python .DLL in your application with SetEnvironmentVariable I fought around with this a bit and decided to use the default installation of Python, this way users could use PIP normally. I have a DLL linked with Python and boost::python, that loads into AutoCAD, maybe you can find some inspiration github.com/CEXT-Dan/PyRxdanielm103– danielm1032024-12-13 08:53:16 +00:00Commented Dec 13, 2024 at 8:53
Add a comment
|