> Fortunately, I've found the cause for this: The `Indexsets.hpp` header has not been included up to that point and static_casts of undefined classes cannot work.

Right.  So, when you do `GlobalIdSet : public GlobalIdMapping` I would expect that you'd *also* be able to remove the `static_cast<>` as that should happen implicitly.  Does that work?