views:

46

answers:

1

I have wondered about this on and off but I never really got a definite answer. Is it possible within the boost.python framework to link against another boost.python module.

For example I have exported class A within boost_python_module(libA) and function B(A a) within boost_python_module(libB). Is it possible to specify in libB to link to A of libA.

The other way of looking at this problem would be that right now I have to generate all my bindings in one shot within one module. Is it possible to generate bindings incrementally over several boost_python_module.

Thanks
Sandeep

A: 

I don't know well shared library, but what works for me is to import all my modules, which can reference with each others, within python: import libA; import libB.

It is of course possible to put these imports in an __init__.py file, so that whitin python you just have to do: import myLib.

rafak
Hi rafak,The problem happens because libA and libB and wrappers for c++ code. How can I pass an object create from libA to a function in libB. -Sandeep
Sandeep
If I understand correclty, I have no problem to do what you want. I think that there is some sort of global register for exported types. So I would first import libA (on which libB depends because it uses class A) and then libB. What error (if any) do you get?
rafak