我在WinXP-32上导入boost-python模块时遇到了问题。我使用的是python 2.6.6、由boostpro提供的预编译库boost.python 1.41和VC++8(VisualStudio 2005)。
在编译以下代码后,我尝试从python命令行导入生成的pyHELLO.pyd,但总是会得到如下错误:
“ImportError: DLL load failed: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.”
我重新安装了python并尝试了其他boost版本。但是没有帮助。
我在尝试导入模块的目录中有相应的boost dlls。
相同的代码在Win7下的VC++9上可正常工作。
以下是代码:
在编译以下代码后,我尝试从python命令行导入生成的pyHELLO.pyd,但总是会得到如下错误:
“ImportError: DLL load failed: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.”
我重新安装了python并尝试了其他boost版本。但是没有帮助。
我在尝试导入模块的目录中有相应的boost dlls。
相同的代码在Win7下的VC++9上可正常工作。
以下是代码:
int sayHello() {
cout << "Hello !" << endl;
}
BOOST_PYTHON_MODULE(pyBoostTest)
{
def("sayHello", sayHello);
}
非常感谢您的帮助。