[C++-sig] How to import a boost::python dll in windows?

fjanoos fjanoos at yahoo.com
Fri Aug 5 22:43:40 CEST 2011

I am having a similar problem as the o.p.

I was trying to build Python wrappers for the hello_ext project given in the
boost tutorial using CMake instead of bjam using the instructions as per

The setup is Boost 1.47.0, Python 2.7, Windows 7 x64, MSVC 2008 (9.0) x64. 

After doing CMake and MSVC - it produces a hello_ext.dll. Even if i rename
this to hello_ext.pyd, Python throws the following error. Any suggestions /
ideas ?


In [12]: ls

 Directory of

05-Aug-11  16:36    <DIR>          .
05-Aug-11  16:36    <DIR>          ..
05-Aug-11  16:34               732 hello_ext.exp
05-Aug-11  16:34           945,152 hello_ext.idb
05-Aug-11  16:34             1,750 hello_ext.lib
05-Aug-11  16:34            11,264 hello_ext.pyd
               4 File(s)        958,898 bytes
               2 Dir(s)  370,089,795,584 bytes free

In [13]: import hello_ext
ImportError                               Traceback (most recent call last)
8768> in <module>()
----> 1 import hello_ext

ImportError: DLL load failed: The specified module could not be found.

View this message in context: http://boost.2283326.n4.nabble.com/C-sig-How-to-import-a-boost-python-dll-in-windows-tp2699467p3722232.html
Sent from the Python - c++-sig mailing list archive at Nabble.com.

More information about the Cplusplus-sig mailing list