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

David Sveningsson ext at sidvind.com
Tue Nov 28 17:24:56 CET 2006


Nicolas Rougier skrev:
> 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).
>   
Yes, but if I have multiple modules in a file it doesn't work
>
> 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
>>     
>
> _______________________________________________
> 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