I want to use an UInterface because I want access to InterfaceCast
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "TargetInterface.generated.h"
/**
*
*/
UINTERFACE(MinimalAPI)
class UTargetInterface : public UInterface
{
GENERATED_UINTERFACE_BODY()
};
class ITargetInterface
{
GENERATED_IINTERFACE_BODY()
public:
virtual FString Name();
};
and
#include “TargetInterface.h”
UTargetInterface::UTargetInterface(const class FPostConstructInitializeProperties& PCIP) : Super(PCIP){
}
FString ITargetInterface::Name(){
return FString("Hello World");
}
And I get the following error.
1> Creating library D:\unreal\ThirdPersonProject\Intermediate\Build\Win64\MyProject3Editor\Development\UE4Editor-MyProject3.lib and object D:\unreal\ThirdPersonProject\Intermediate\Build\Win64\MyProject3Editor\Development\UE4Editor-MyProject3.exp
1>MyProject3.cpp.obj : error LNK2019: unresolved external symbol “public: __cdecl UTargetInterface::UTargetInterface(class FPostConstructInitializeProperties const &)” (??0UTargetInterface@@QEAA@AEBVFPostConstructInitializeProperties@@@Z) referenced in function “void __cdecl InternalConstructor(class FPostConstructInitializeProperties const &)” (??$InternalConstructor@VUTargetInterface@@@@YAXAEBVFPostConstructInitializeProperties@@@Z)
1>D:\unreal\ThirdPersonProject\Binaries\Win64\UE4Editor-MyProject3.dll : fatal error LNK1120: 1 unresolved externals
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: D:\unreal\ThirdPersonProject\Binaries\Win64\UE4Editor-MyProject3.dll