Case:
elliptics/utils.hpp
boost/python/object.hpp

is the same to:
string
string.h
elliptics/core.h
boost/python/object.hpp

and it causes the error.

I think elliptics/core.h makes some changes to generic macros which affect to boost python, but it takes place only if we includes string and string.h before core.h