3
votes

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.

1
Does your Python .exe have an application manifest that specifies the SxS details for MSVCRT? - David Heffernan
do you mean boost python 1.41? - Matthew Scouten
1. I'm new on Windows and don't know about the manifest-thing, but the dependency walker shows me that python.exe depends on a MSVCR90.dll which is located in the winsxs folder (If that's what you mean) 2. Yes, it's boost python 1.41 - Romain Scherfflein
Resolved this. The correct version of the MSVC80CRT dll on which the boost.python dll depends was missing. So I downloaded the corresponding redist package from MS and installed it. Now it works. The dependencywalker not show a missing dependeny for this dll. I read a bit about manifests and SxS and looked into the dll headers to see which CRT version was needed. Thanks David for th hint on this. - Romain Scherfflein
Please add this as an answer to your original question so that you can mark it as resolved and so that you may receive the bounty. - Miriam

1 Answers

0
votes

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.