The macro URHO3D_OBJECT
in class Texture3D
complains Call to GetTypeInfoStatic is ambiguous when I open the project in Clion, but it compiles well on VS2017.
So I find the generated preprocessed file use the method described on SO here and replace the macro,
public:
using ClassName = Texture3D;
using BaseClassName = Texture;
virtual Urho3D::StringHash GetType() const override { return GetTypeInfoStatic()->GetType(); }
virtual const Urho3D::String& GetTypeName() const override { return GetTypeInfoStatic()->GetTypeName(); }
virtual const Urho3D::TypeInfo* GetTypeInfo() const override { return GetTypeInfoStatic(); }
static Urho3D::StringHash GetTypeStatic() { return GetTypeInfoStatic()->GetType(); }
static const Urho3D::String& GetTypeNameStatic() { return GetTypeInfoStatic()->GetTypeName(); }
static const Urho3D::TypeInfo* GetTypeInfoStatic()
{
static const Urho3D::TypeInfo typeInfoStatic("Texture3D",BaseClassName::GetTypeInfoStatic());
return &typeInfoStatic;
};
It turned out the code BaseClassName::GetTypeInfoStatic()
cause this.
seems like Texture class does not define it’s owne GetTypeInfoStatic function, but inherit from Object/Resource/ResourceWithMetadata class, so it is ambigusou ??
It’s weird that VS does not report this issue
The same happens in class Texture2D