[C++-sig] Multiple modules in a file

Nicolas Rougier Nicolas.Rougier at loria.fr
Tue Nov 28 16:09:41 CET 2006


It may be a problem related to your library filename (at linking time)
that does not match the name you defined in the boot python module:

BOOST_PYTHON_MODULE(core)
requires for example "core.so" for the name of your library file (at
least on linux).


Nicolas


On Tue, 2006-11-28 at 13:08 +0100, David Sveningsson wrote:
> Hi, I am quite new at extending python with c++. I am using the boost
> libraries on gnu/linux. I have many classes (with inheritance) that I
> would like to expose to python. Is there some way to have many python
> modules in one file?
> 
> Like, core.so contains a string class and a memory class. I tried just
> compiling everything as a shared library and importing into python with
> "import core.string" but then I get the error "ImportError: dynamic
> module does not define init function (initcore)"
> 
> Im not really sure what that means.
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig




More information about the Cplusplus-sig mailing list