# Why does BindKey cause Link error?

**URL:** <https://forums.unrealengine.com/t/why-does-bindkey-cause-link-error/35447>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [July 15, 2015, 4:17am UTC](https://forums.unrealengine.com/t/why-does-bindkey-cause-link-error/35447 "2015-07-15T04:17:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_488763aa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_488763aa](https://forums.unrealengine.com/u/anonymous_user_488763aa)\
**Post date:** [July 15, 2015, 4:17am UTC](https://forums.unrealengine.com/t/why-does-bindkey-cause-link-error/35447/1 "2015-07-15T04:17:00Z")

</div>

```auto

InputComponent->BindKey(EKeys::LeftShift, IE_Pressed, this, &ALedgeClimbCharacterBase::ShiftPressed);

```

Got these while link:

```auto

27>LedgeClimbCharacterBase.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public:__cdecl FInputChord::FInputChord(struct FKey,bool,bool,bool,bool)" (__imp_??0FInputChord@@QEAA@UFKey@@_N111@Z) referenced in function "public: struct FInputKeyBinding &__cdecl UInputComponent::BindKey<class ALedgeClimbCharacterBase>(struct FKey,enum EInputEvent,class ALedgeClimbCharacterBase *,void (__cdecl ALedgeClimbCharacterBase::*)(void))" (??$BindKey@VALedgeClimbCharacterBase@@@UInputComponent@@QEAAAEAUFInputKeyBinding@@UFKey@@W4EInputEvent@@PEAVALedgeClimbCharacterBase@@P84@EAAXXZ@Z)
27>LedgeClimbCharacterBase.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public:__cdecl FInputChord::FInputChord(struct FInputChord const &)" (__imp_??0FInputChord@@QEAA@AEBU0@@Z) referenced in function "public: struct FInputKeyBinding &__cdecl UInputComponent::BindKey<class ALedgeClimbCharacterBase>(struct FInputChord,enum EInputEvent,class ALedgeClimbCharacterBase *,void (__cdecl ALedgeClimbCharacterBase::*)(void))" (??$BindKey@VALedgeClimbCharacterBase@@@UInputComponent@@QEAAAEAUFInputKeyBinding@@UFInputChord@@W4EInputEvent@@PEAVALedgeClimbCharacterBase@@P84@EAAXXZ@Z)
27>LedgeClimbCharacterBase.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public:__cdecl FInputChord::~FInputChord(void)" (__imp_??1FInputChord@@QEAA@XZ) referenced in function "public: struct FInputKeyBinding &__cdecl UInputComponent::BindKey<class ALedgeClimbCharacterBase>(struct FInputChord,enum EInputEvent,class ALedgeClimbCharacterBase *,void (__cdecl ALedgeClimbCharacterBase::*)(void))" (??$BindKey@VALedgeClimbCharacterBase@@@UInputComponent@@QEAAAEAUFInputKeyBinding@@UFInputChord@@W4EInputEvent@@PEAVALedgeClimbCharacterBase@@P84@EAAXXZ@Z)

```

---

<div class="post-metadata">

**Author:** ![Pierdek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pierdek](https://forums.unrealengine.com/u/Pierdek)\
**Post date:** [July 15, 2015, 9:41am UTC](https://forums.unrealengine.com/t/why-does-bindkey-cause-link-error/35447/2 "2015-07-15T09:41:53Z")

</div>

Probably because your project is missing some dependencies:

search a MyProject.Build.cs somewhere in the MyProject\Source\MyProject\ directory and add

“SlateCore”,  
“Slate”,

in the PublicDependencyModuleNames section.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_488763aa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_488763aa](https://forums.unrealengine.com/u/anonymous_user_488763aa)\
**Post date:** [July 15, 2015, 10:02am UTC](https://forums.unrealengine.com/t/why-does-bindkey-cause-link-error/35447/3 "2015-07-15T10:02:53Z")

</div>

> [@Pierdek;332812](#):
>
> Probably because your project is missing some dependencies:
> 
> search a MyProject.Build.cs somewhere in the MyProject\Source\MyProject\ directory and add
> 
> “SlateCore”,  
> “Slate”,
> 
> in the PublicDependencyModuleNames section.

Problem solved! Thx very much.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8b723f8a1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8b723f8a1](https://forums.unrealengine.com/u/anonymous_user_8b723f8a1)\
**Post date:** [August 12, 2015, 11:17pm UTC](https://forums.unrealengine.com/t/why-does-bindkey-cause-link-error/35447/4 "2015-08-12T23:17:45Z")

</div>

Thank you! I wasted an hour trying to figure this out! Problem solved 30 seconds after finding this thread.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_19bed0b11](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_19bed0b11](https://forums.unrealengine.com/u/anonymous_user_19bed0b11)\
**Post date:** [February 26, 2017, 3:42am UTC](https://forums.unrealengine.com/t/why-does-bindkey-cause-link-error/35447/5 "2017-02-26T03:42:00Z")

</div>

Thank you so much!

---

<div class="post-metadata">

**Author:** ![beldmitra](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@beldmitra](https://forums.unrealengine.com/u/beldmitra)\
**Post date:** [December 3, 2020, 8:21pm UTC](https://forums.unrealengine.com/t/why-does-bindkey-cause-link-error/35447/6 "2020-12-03T20:21:51Z")

</div>

I’ve got a similar issue. I added “InputCore” module to PrivateDependencyModuleNames in Build.cs

---

<div class="post-metadata">

**Author:** ![EleCelis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EleCelis](https://forums.unrealengine.com/u/EleCelis)\
**Post date:** [April 12, 2021, 4:56am UTC](https://forums.unrealengine.com/t/why-does-bindkey-cause-link-error/35447/7 "2021-04-12T04:56:34Z")

</div>

thanks! It helped me… how did you know that were those modules?

---

<div class="post-metadata">

**Author:** ![Altrue](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/altrue/32/1186768_2.png) [@Altrue](https://forums.unrealengine.com/u/Altrue)\
**Post date:** [April 12, 2021, 6:27am UTC](https://forums.unrealengine.com/t/why-does-bindkey-cause-link-error/35447/8 "2021-04-12T06:27:47Z")

</div>

- You can either look at the declaration of the thing with the link error in UE4s source code, and see which module it is in
- Or you can go to [Unreal Engine API Reference | Unreal Engine Documentation](https://docs.unrealengine.com/en-US/API/index.html) and find the thing you are looking for, then look at the “Module” field.
  - (just google UE4 + “the thing” and select the link titled “The Thing - Unreal Engine Documentation”

Sometimes the error doesn’t come from the function / class / struct itself but from one of its parameters / return values. So if your are certain that you have already the module for “The thing” in your build.cs, it’s a good idea to follow the links to the parameters / return values to see which one has a module you don’t have.

NOTE: If you are using the Unreal Engine API website, it is the exact same process if you want to find the include text for a specific thing. Only instead of looking at the “Module” field, you’d look at the “Include” field.
