Hi, Unreal gurus,
I have a clean project. And It can trigger a very different behavior when compile in Development/Debug mode. And I’m afraid I’m out of idea about why could this happen.
Let me go through how can it be reproduced first.
- git clone my project
- install my plugin(Fuyuri Seiichi / 8 Direciton Swipe Input Plugin · GitLab) with RunUAT.sh
- /GenerateProjectFiles.sh -game -engine -project=MyProject.uproject
- make MyProjectEditor OTHERWISE make MyProjectEditor-Linux-Debug
While the former can compile successfully without any problem.
The latter generate the following error:
[40/41] Link (lld) libUE4Editor-MyProject-Linux-DebugGame.so
ld.lld: error: undefined symbol: vtable for IAttackMotionState
>>> referenced by IAttackMotionState.h:12 (/home/sbbg/Projects/MyProject/Source/MyProject/Components/Interfaces/IAttack\
MotionState.h:12)
>>> /home/sbbg/Projects/MyProject/Intermediate/Build/Linux/B4D820EA/UE4Editor/DebugGame/MyProject/Gesture\
dAttackActorComponent.cpp.o:(IAttackMotionState::IAttackMotionState())
>>> did you mean: vtable for UAttackMotionState
>>> defined in: /home/sbbg/Projects/MyProject/Intermediate/Build/Linux/B4D820EA/UE4Editor/DebugGame/MyProject/IAttackMotionState.gen.cpp.o
the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfu\
nction)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:306: MyProjectEditor-Linux-DebugGame] Error 6
(I cannot open my project, because it contains some marketplace assets. If you’re really willing to help and agree to not leak them, please reply me.)
While the IAttackMotionState.h is VERY simple interface like this:
#pragma once
#include "IAttackMotionState.generated.h"
UINTERFACE( MinimalAPI, Blueprintable, meta = (CannotImplementInterfaceInBlueprint) )
class UAttackMotionState : public UInterface
{
GENERATED_BODY()
};
class INTUITIVEMELEECOMBAT_API IAttackMotionState
{
GENERATED_BODY()
public:
UFUNCTION( BlueprintCallable, Category = "ARPG Attack Motion Interface" )
virtual bool getIsReadyToAttack(); // This character can perform attack in this state.
UFUNCTION( BlueprintCallable, Category = "ARPG Attack Motion Interface" )
virtual bool getIsAttacking(); // In other words: it's playing attack montage or not!
UFUNCTION( BlueprintCallable, Category = "ARPG Attack Motion Interface" )
virtual bool getIsCancellable(); // Is the performing attack cancellable ??
UFUNCTION( BlueprintCallable, Category = "ARPG Attack Motion Interface" )
virtual bool getIsDuringAtkCD(); // The character has complete an attack and is cooling down.
//UFUNCTION( BlueprintCallable, Category = "ARPG_ATTACKMOTION_ACTORCOMPONENT_INFO" )
// bool getIsStaggering(); // The character was hit and is staggering(taking damage)
};
Do you have any idea about how could this happen? I believe the constructor is supposed to be done by GENERATED_BODY() macros, isn’t it?
I might still need my debugger later in the development. Please give me any idea if you’ve ever come off.
Thank you.