Build problems when adding `__str__` method to Boost Python C++ class
I recently encountered this problem;The solution that worked was to explicitly resolve the str
and self
on this line:
.def(str(self))
So that it becomes:
.def(self_ns::str(self_ns::self))
I don't know why this is necessary, (knowing something of the overload-resolution complication that goes on in boost python, it's probably something there...) but it worked for me :)
I ran into the same thing. Adding this line (instead of qualifying str and self) also works:
using self_ns::str;