Examples Boost.Python, Windows 7 x64, "ImportError: DLL failed: the specified module was not found."

I spent the last 2 days trying to run examples from Boost.Python with the error "Error loading ImportError: DLL: the specified module was not found" while trying to load compiled (using bjam) pyd modules. I used Windows 7 x64, Python 2.7 x64 with Boost 1.47. I tracked various responses to StackOverflow and other sites, including. fresh installations (Python 32 and 64 bit, Boost precompiled), a guide to creating Boost libraries, checking DLLs using the dependency walker, etc., without any luck. I registered to share the solution that worked here and which I hope can help someone struggling with the same error;)

+5
source share
3 answers

The problem was updating Windows KB2264107 (http://support.microsoft.com/kb/2264107), "messing" with a regular DLL search program (security patch). Setting the registry value [HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Session Manager]: CWDIllegalInDllSearch to 0 allows you to load DLL files correctly and import .pyd modules correctly. This can happen on other versions of Windows.

+2
source

Two solutions, no need to use regedit

  • add BOOST_PYTHON_STATIC_LIBmarco when creating your dll. This will allow boost.python a static link to your dll file, not a dynamic load at runtime.
  • boost.python dll PATH , dll
+4

my soluition is loaded by microsoft visual C ++ 2015 redistribute https://www.microsoft.com/en-us/download/details.aspx?id=48145

0
source

All Articles