# Can't solve a linker error developing a Custom Editor Mode

**URL:** <https://forums.unrealengine.com/t/cant-solve-a-linker-error-developing-a-custom-editor-mode/605981>\
**Category:** C++\
**Tags:** unreal-engine, UE5-0, CPP, question\
**Created:** [July 16, 2022, 1:17am UTC](https://forums.unrealengine.com/t/cant-solve-a-linker-error-developing-a-custom-editor-mode/605981 "2022-07-16T01:17:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucho1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lucho1](https://forums.unrealengine.com/u/lucho1)\
**Post date:** [July 16, 2022, 1:17am UTC](https://forums.unrealengine.com/t/cant-solve-a-linker-error-developing-a-custom-editor-mode/605981/1 "2022-07-16T01:17:28Z")

</div>

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:

```auto
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:

```auto
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)

```

---

<div class="post-metadata">

**Author:** ![Chatouille](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chatouille/32/1194622_2.png) [@Chatouille](https://forums.unrealengine.com/u/Chatouille)\
**Post date:** [July 18, 2022, 1:42pm UTC](https://forums.unrealengine.com/t/cant-solve-a-linker-error-developing-a-custom-editor-mode/605981/2 "2022-07-18T13:42:45Z")

</div>

Try adding “UnrealEd” to your dependency modules in your Build.cs file

---

<div class="post-metadata">

**Author:** ![lucho1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lucho1](https://forums.unrealengine.com/u/lucho1)\
**Post date:** [July 18, 2022, 4:45pm UTC](https://forums.unrealengine.com/t/cant-solve-a-linker-error-developing-a-custom-editor-mode/605981/3 "2022-07-18T16:45:25Z")

</div>

It already was, I tried removing it but it didn’t worked ☹

---

<div class="post-metadata">

**Author:** ![lucho1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lucho1](https://forums.unrealengine.com/u/lucho1)\
**Post date:** [July 18, 2022, 5:06pm UTC](https://forums.unrealengine.com/t/cant-solve-a-linker-error-developing-a-custom-editor-mode/605981/4 "2022-07-18T17:06:38Z")

</div>

I’m looking that the `FEditorModeInfo` has `EDITORFRAMEWORK_API` in its constructors, which I think is basically a `declspec(import)`, maybe that has something to do?

---

<div class="post-metadata">

**Author:** ![Chatouille](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chatouille/32/1194622_2.png) [@Chatouille](https://forums.unrealengine.com/u/Chatouille)\
**Post date:** [July 19, 2022, 7:30am UTC](https://forums.unrealengine.com/t/cant-solve-a-linker-error-developing-a-custom-editor-mode/605981/5 "2022-07-19T07:30:33Z")

</div>

Oh well that looks like a new UE5 exoticism.  
Well try adding “EditorFramework” to the dependencies then

---

<div class="post-metadata">

**Author:** ![lucho1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lucho1](https://forums.unrealengine.com/u/lucho1)\
**Post date:** [July 20, 2022, 1:12pm UTC](https://forums.unrealengine.com/t/cant-solve-a-linker-error-developing-a-custom-editor-mode/605981/6 "2022-07-20T13:12:23Z")

</div>

Wow that made it working!!! Thank you very much, I was super stuck and frustrated with this 🙂

---

<div class="post-metadata">

**Author:** ![Mardivil](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mardivil](https://forums.unrealengine.com/u/Mardivil)\
**Post date:** [July 22, 2023, 7:01pm UTC](https://forums.unrealengine.com/t/cant-solve-a-linker-error-developing-a-custom-editor-mode/605981/7 "2023-07-22T19:01:51Z")

</div>

Awesome! Thanks!

---

<div class="post-metadata">

**Author:** ![tancen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tancen](https://forums.unrealengine.com/u/tancen)\
**Post date:** [April 17, 2025, 3:33am UTC](https://forums.unrealengine.com/t/cant-solve-a-linker-error-developing-a-custom-editor-mode/605981/8 "2025-04-17T03:33:09Z")

</div>

I got here via google and I want to say to anyone coming after me, don’t forget to add YOUR\_MODULE\_NAME\_API to your C++ class
