Software info up front:
MSVC 2008/9.0 (my company has a hard time letting go)
Boost 1.64
Python 2.7 (a really hard time letting go)
We're converting a DLL module for one of our programs to be able to run Python scripts that can interface back with the module, so I've been wiring up Boost.Python. I made a very simple example following the tutorial:
using namespace boost::python;
BOOST_PYTHON_MODULE(PythonModule)
{
class_<CPythonModule, boost::noncopyable>("PythonModule")
.def("foo", &CPythonModule::foo)
;
}
(Edit: my use of noncopyable here could be incorrect; we have an instance of an object that will be running the python scripts, and this was needed to compile to eliminate private function errors)
And the even simpler Python script that doesn't even do anything but import for now:
import PythonModule
Everything compiled, ran the script... Import failure. Learned I had to switch the DLL file extension to .pyd, and ran it again, hit a slightly different error:
ImportError: DLL load failed: The specified module could not be found.
I can't manage to make this one go away. I have included the boost DLLs in the running directory alongside the scripts, no dice. From what I can see, it is actually finding the .pyd, but something else is going wrong after that. Things I've made sure of:
C++ 'Additional Include' includes paths to "python27\includes" and "boost_1_64_0".
Linker 'Additional Library' directories includes paths to "Python27\libs" and "boost_1_64_0\lib32-msvc-9.0".
Somewhere along the way in trying to eliminate the error as I went through SO posts, I also went ahead and tried adding these to the Linker's additional dependencies:
C:\local\boost_1_64_0\lib32-msvc-9.0\boost_python-vc90-mt-1_64.lib
C:\local\boost_1_64_0\lib32-msvc-9.0\boost_python-vc90-mt-gd-1_64.lib
C:\local\boost_1_64_0\lib32-msvc-9.0\libboost_python-vc90-mt-1_64.lib
C:\local\boost_1_64_0\lib32-msvc-9.0\libboost_python-vc90-mt-gd-1_64.lib
My environment paths also include Boost, Python, and even the specific directory I've tried running the script from.