I’m just trying to get a very basic very straight forward interface with two methods OnGrab and OnRelease working in c++. I feel like this shouldn’t be that hard to do.
This is my header currently
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Grabbable.generated.h"
/**
*
*/
UINTERFACE(MinimalAPI)
class GODGAME_API UGrabbable : public UInterface
{
GENERATED_UINTERFACE_BODY()
};
class IGrabbable
{
GENERATED_IINTERFACE_BODY()
};
and my .cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "GodGame.h"
#include "Grabbable.h"
first error in the compiler
Error D:\Unreal\GodGame\Source\GodGame\Public\Grabbable.h(13) : error C2487: ‘GetPrivateStaticClass’: member of dll interface class may not be declared with dll interface
I’ve now looked at 4 different tutorials online dealing with C++ interfaces in unreal and they all point to roughly this structure but I can’t get it to compile for the life of me. I’ve even tried just doing it in a totally clean project with no luck. Ideally I want this interface to be usable in blueprints but I’m considering that secondary to getting it usable at all. What am I doing wrong here?