I have problems importing a boost-python module on WinXP-32.
I’m using python 2.6.6, boost.python 1.41 precompiled libs by boostpro and VC++8 (VisualStudio 2005).
After compiling the piece of code below, I tried to import the resulting pyHELLO.pyd from the python command line and always get:
“ImportError: DLL load failed: This
application has failed to start
because the application configuration
is incorrect. Reinstalling the
application may fix this problem.”
I re-installed python and tried other boost versions. But none of it helped.
I have the corresponding boost dlls in the directory where I tried to import the module.
The same code works with VC++9 under Win7.
Here’s the code:
int sayHello() {
cout << "Hello !" << endl;
}
BOOST_PYTHON_MODULE(pyBoostTest)
{
def("sayHello", sayHello);
}
Any help highly appreciated.
Resolved:
The correct version of the MSVC80CRT dll on which the boost.python dll depends was missing on my machine. I downloaded the corresponding redist package from MS and installed it. Now it works.
The dependencywalker did not show a missing dependency for this dll.
After reading about manifests and SxS I found out that the correct dll version is stated
in the manifest which itself is embedded in the dll header.
If you open a dll in Visual Studio you can read the information. Then you check if the
dll version is present in the c:\windows\winsxs folder. If not you can retrieve the missing
dll by downloading a corresponding “redist” package from MS. Just search for the dll version.
Thanks to David for giving the hint on manifests.