Suppose I have two boost python modules that are defined as follows. Module A:
class SomeClass {
public:
SomeClass() {}
~SomeClass() {}
};
BOOST_PYTH
Based on your latest response and updated error message in your question, I think the problem might be because your BOOST_PYTHON_MODULE
usage might be incorrect (based on what I've seen in other examples of using it). Try something like this and see if it helps:
Module A:
class SomeClass {
public:
SomeClass() {}
~SomeClass() {}
};
BOOST_PYTHON_MODULE(A)
{
boost::python::class_("SomeClass");
}
And module B:
class AnotherClass {
public:
AnotherClass() {}
~AnotherClass() {}
void func(SomeClass& sp) {}
};
BOOST_PYTHON_MODULE(B)
{ boost::python::class_("AnotherClass")
.def("func", &AnotherClass::func)
;
}
Note the insertion of a "boost::python::
" prefix onto the class_<...>
statement in each of the two BOOST_PYTHON_MODULE
declarations.