Hi!
I’m doing a custom Editor Mode for UE5 through a EditorModeTool
module class (inherits from ITemplateModuleListener
).
However I have a “unresolved external” linker error since some time ago that I can’t still figure out how to solve. I’ll leave the error below but so far I know it happens in the OnModuleStartup()
function of the module where I register the Editor Mode using the following code:
FEditorModeRegistry::Get().RegisterMode<FEditorMode>(
FCustomEditorMode::ModeID,
FText::FromString("CustomMode"),
FSlateIcon(customStyleSet->GetStyleSetName(), FName("icon"), FName("icon.Small")),
true,
500);
And judging by the error wording I assume the problem is that the RegisterMode()
function is trying to create a FEditorModeInfo(...)
that triggers the mentioned linker error. If I try to create the FEditorModeInfo
by myself (for instance in the OnModuleStartup()
) I get the linker error referencing on my function.
So the thing is that I don’t know exactly what is causing this, I tried to include a couple of files in my class and remove some (looking at the includes that the related files have) but nothing is working, and since I’ve been with this for some days I’m quite stuck , does someone sees what is going on?
The linker error says the following:
error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl FEditorModeInfo::FEditorModeInfo(class FName,class FText,struct FSlateIcon,class TAttribute<bool>,int)" (__imp_??0FEditorModeInfo@@QEAA@VFName@@VFText@@UFSlateIcon@@V?$TAttribute@_N@@H@Z) referenced in function "public: virtual void __cdecl EditorModeTool::OnModuleStartup(void)" (?OnModuleStartup@EditorModeTool@@UEAAXXZ)