Cross module dependencies in Boost Python
Suppose I have two boost python modules that are defined as follows. Module A: class SomeClass { public: SomeClass() {} ~SomeClass() {} }; BOOST_PYTHON_MODULE(A) { class_<SomeClass>("SomeClass"); } And module B: class AnotherClass { public: AnotherClass() {} ~AnotherClass() {} void func(SomeClass& sp) {} }; BOOST_PYTHON_MODULE(B) { class_<AnotherClass>("AnotherClass") .def("func", &AnotherClass::func) ; } Module B has a dependency on module A (i.e. it uses SomeClass from module A). Now, I execute the following python script: import A import B obj1 = A.SomeClass() obj2 = B.AnotherClass() obj2