When defining own messages derived from igtl::MessageBase or other bases, the igtlTypeMacro can only be used when the defining class is inside the igtl namespace. The reason is the reference to the SmartPointer template which is not fully qualified in the macro. A workaround is to use a template<typename T> using SmartPointer = igtl::SmartPointer<T>; before using the macro, but in my opinion the macro should be changed to use igtl::SmartPointer directly instead.