Unresolved external symbol

So I tried to make some functions in an interface I made,…

virtual bool IsHoldingLedge();
virtual bool NotHoldingLedge();

…and I tried to override it in my character class like this.

UFUNCTION(BlueprintCallable, BlueprintImplementableEvent, Category = "Character States")
bool IsHoldingLedge() override;
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent, Category = "Character States")
bool NotHoldingLedge() override;

Every time I try to compile it, I get these errors:

error LNK2001: unresolved external symbol “public: virtual bool __cdecl ICharacterInterface::IsHoldingLedge(void)” (?IsHoldingLedge@ICharacterInterface@@UEAA_NXZ)

error LNK2001: unresolved external symbol “public: virtual bool __cdecl ICharacterInterface::IsHoldingLedge(void)” (?IsHoldingLedge@ICharacterInterface@@UEAA_NXZ)

Does anyone know what these errors mean and how I can solve my issue?

I haven’t used interfaces in Unreal, but I think you need to define the methods for the ICharacterInterface class. It’s hard to know without seeing the entire declaration of the classes and how you defined the methods.

Ok, I have definitions for the functions in both the interface and my character class.
CharacterInterface.cpp:

bool ICharacterInterface::IsHoldingLedge()
{
	return true;
}

CharacterInterface.h (According to Epic’s documentation on interfaces, it is common practice to write functions in here, “…when a function does nothing by default, or has a trivial behavior like returning false, zero, an empty string (or something similar).”:

virtual bool NotHoldingLedge()
{
	return false;
};

SideScrollerExample2Character.cpp

bool ASideScrollerExample2Character::IsHoldingLedge()
 { 
           return true;
 }

//...

bool ASideScrollerExample2Character::NotHoldingLedge()
{
           return false;
}

Not only do I have the same errors as before, but I also have things like ““public: virtual bool __cdecl ASideScrollerExample2Character::IsHoldingLedge(void)” (?IsHoldingLedge@ASideScrollerExample2Character@@UEAA_NXZ) already defined in SideScrollerExample2Character.cpp.obj” (there’s one for NotHoldingLedge as well).

The “already defined” error is because you defined the function in both the CharacterInterface.h and the CharacterInterface.cpp file, if I am understanding you correctly. You must define it, but you are only allowed to define it in one place – either in the header file or the cpp file.

The previous error with the unresolved external means that a function was declared but the linker is unable to find the implementation (definition) of that function. UE’s macros do some stuff behind the scenes that makes it hard to track some of those down – at least, I have encountered that type of thing with BlueprintImplementable events before. Have you looked at this discussion of interfaces? If you can’t get it resolved, I recommend posting the entire class declarations and method definitions. Linker problems can be in your declaration, the definitions, or something the UE4 macros are doing that expect you to provide a method definition. If you did not have definitions for those methods before your first post, and added them to both the .h and the .cpp file in response to my post, try removing the definitions from the .h file.