Inconsistent dll linkage warning/error when inheriting from Character

PlatformerPrototype\Intermediate\Build\Win64\Inc\PlatformerPrototype\PlatformerPrototype.generated.inl(15): error C2220: warning treated as error - no ‘object’ file generated
PlatformerPrototype\Intermediate\Build\Win64\Inc\PlatformerPrototype\PlatformerPrototype.generated.inl(15): warning C4273: ‘ACustomCharacter::StaticRegisterNativesACustomCharacter’ : inconsistent dll linkage
platformerprototype\source\platformerprototype\CustomCharacter.h(18) : see previous definition of ‘StaticRegisterNativesACustomCharacter’

The above is the error/warnings I get when I try to build. I wanted to use Character.cpp, but with a different collision component (box instead of capsule), so I used the Add New Code to Project function to add a new class (child of Pawn), then copied and pasted Character.cpp/h into the new class, making modifications as necessary to remove references to capsule code.

Could you try adding the API macro for your module to the class declaration?

This is of the form “MODULENAME_API”, eg) MYPROJECT_API

class MYPROJECT_API ACustomCharacter

Thanks. That cleared up that error, but opened up a few more that don’t make much sense to me:

CustomCharacter.cpp.obj : error LNK2019: unresolved external symbol "public: class FName __cdecl FAnimMontageInstance::GetCurrentSection(void)const " (?GetCurrentSection@FAnimMontageInstance@@QEBA?AVFName@@XZ) referenced in function “public: virtual void __cdecl ACustomCharacter::DisplayDebug(class UCanvas *,class TArray const &,float &,float &)” (?DisplayDebug@ACustomCharacter@@UEAAXPEAVUCanvas@@AEBV?$TArray@VFName@@VFDefaultAllocator@@@@AEAM2@Z)
1>CustomCharacter.cpp.obj : error LNK2019: unresolved external symbol "public: class FTransform __cdecl UAnimMontage::ExtractRootMotionFromTrackRange(float,float)const " (?ExtractRootMotionFromTrackRange@UAnimMontage@@QEBA?AVFTransform@@MM@Z) referenced in function “public: void __cdecl ACustomCharacter::SimulatedRootMotionPositionFixup(float)” (?SimulatedRootMotionPositionFixup@ACustomCharacter@@QEAAXM@Z)
1>CustomCharacter.cpp.obj : error LNK2001: unresolved external symbol “protected: virtual void __cdecl ACustomCharacter::PostNetReceiveBase(void)” (?PostNetReceiveBase@ACustomCharacter@@MEAAXXZ)
1>PlatformerPrototype.cpp.obj : error LNK2001: unresolved external symbol “protected: virtual void __cdecl ACustomCharacter::PostNetReceiveBase(void)” (?PostNetReceiveBase@ACustomCharacter@@MEAAXXZ)
1>CustomCharacter.cpp.obj : error LNK2001: unresolved external symbol “public: virtual void __cdecl ACustomCharacter::PreNetReceive(void)” (?PreNetReceive@ACustomCharacter@@UEAAXXZ)

Edit: Took out the offending code, as it was unnecessary anyway (netcode stuff and some debug info)