[英]Boost.Python examples, Windows 7 x64, “ImportError: DLL load failed: The specified module could not be found.”
I've spent last 2 days trying to launch examples from Boost.Python with the "ImportError: DLL load failed: The specified module could not be found" error, while trying to load compiled (using bjam) pyd modules. 我花了两天的时间尝试从Boost.Python启动带有“导入错误:DLL加载失败:找不到指定的模块”错误的示例,同时尝试加载已编译(使用bjam)的pyd模块。 I was using Windows 7 x64, Python 2.7 x64 with Boost 1.47.
我使用的是Windows 7 x64,Python 2.7 x64和Boost 1.47。 I've followed up different answers on StackOverflow and other sites incl.
我已经在StackOverflow和其他网站上追踪了不同的答案。 fresh installs (Python 32 and 64 bit, Boost precompiled), manual Boost's libraries building, DLL checks with dependency walker and so on, with no luck.
全新安装(Python 32和64位,Boost预编译),手动Boost的库构建,带有依赖项遍历器的DLL检查等等,没有运气。 I registered to share the solution, which worked here and which I hope may help someone, struggling with the same error ;)
我注册分享了解决方案,该解决方案在这里有效,希望对遇到同样错误的人有所帮助;)
Two solution, no need to use regedit 两种解决方案,无需使用regedit
BOOST_PYTHON_STATIC_LIB
marco when build your dll. BOOST_PYTHON_STATIC_LIB
marco。 It will let boost.python static link to your dll file rather than dynamic load in runtime. The problem was with the KB2264107 Windows update (http://support.microsoft.com/kb/2264107), "messing" with DLL search routine (security fix). 问题出在Windows更新KB2264107(http://support.microsoft.com/kb/2264107)上,带有DLL搜索例程的“消息”(安全修补程序)。 Setting the registry value [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager] : CWDIllegalInDllSearch to 0, allowed to properly load DLL files and properly import .pyd modules.
将注册表值[HKEY_LOCAL_MACHINE \\ SYSTEM \\ CurrentControlSet \\ Control \\ Session Manager]设置为:CWDIllegalInDllSearch设置为0,可以正确加载DLL文件并正确导入.pyd模块。 This may also happen on other Windows versions.
在其他Windows版本上也可能会发生这种情况。
我的解决方案是下载Microsoft Visual C ++ 2015重新分发 https://www.microsoft.com/zh-cn/download/details.aspx?id=48145
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.