python - WinXP 上的 boost.python "DLL load failed",VisualStudio 2005

标签 python visual-studio-2005 windows-xp boost-python

我在 WinXP-32 上导入 boost-python 模块时遇到问题。 我正在使用 python 2.6.6,boostpro 和 VC++8 (VisualStudio 2005) 的 boost.python 1.41 预编译库。

在编译下面的这段代码后,我尝试从 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 dll。

同样的代码可以在 Win7 下使用 VC++9。

代码如下:

int sayHello() {
    cout << "Hello  !" << endl; 
}


BOOST_PYTHON_MODULE(pyBoostTest)
{
    def("sayHello", sayHello);
}

非常感谢任何帮助。

最佳答案

已解决:

我的机器上缺少 boost.python dll 所依赖的 MSVC80CRT dll 的正确版本。我从MS下载了相应的redist包并安装了。现在可以了。

dependencywalker 没有显示此 dll 缺少依赖项。 阅读 list 和 SxS 后,我发现说明了正确的 dll 版本 在本身嵌入在 dll header 中的 list 中。

如果您在 Visual Studio 中打开一个 dll,您可以阅读其中的信息。然后你检查是否 dll 版本存在于 c:\windows\winsxs 文件夹中。如果没有,你可以找回丢失的 dll 通过从 MS 下载相应的“redist”包。只需搜索 dll 版本即可。

感谢 David 在 list 上给出的提示。

关于python - WinXP 上的 boost.python "DLL load failed",VisualStudio 2005,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6492602/

相关文章:

python - 如何使此脚本由消息触发实时运行

python - docker 容器 : UDP Communication with other hosts

python - Pybind11:创建数据的 numpy View

python - 如何按特定列分配新的值列?

c++ - 无法将 const char * 转换为 char *

visual-c++ - fatal error LNK1179 : invalid or corrupt file: duplicate COMDAT '_IID_IXMLDOMImplementation'

c# - 命名空间 System.Configuration 中不存在 configurationManager

windows - 获取在 Windows XP 上复制文件的时间和日期

java - Android 应用程序未在 Virtual Box 上运行吗?

windows-xp - 识别 DNS​​ 请求的 PID 源 (Windows XP)