# Can't get a character to compile after binding a key to the InputComponent

**URL:** <https://forums.unrealengine.com/t/cant-get-a-character-to-compile-after-binding-a-key-to-the-inputcomponent/488176>\
**Category:** Character & Animation\
**Tags:** unreal-engine, compile-error, question, key-bind\
**Created:** [August 30, 2021, 7:03am UTC](https://forums.unrealengine.com/t/cant-get-a-character-to-compile-after-binding-a-key-to-the-inputcomponent/488176 "2021-08-30T07:03:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DigitalCyan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DigitalCyan](https://forums.unrealengine.com/u/DigitalCyan)\
**Post date:** [August 30, 2021, 7:03am UTC](https://forums.unrealengine.com/t/cant-get-a-character-to-compile-after-binding-a-key-to-the-inputcomponent/488176/1 "2021-08-30T07:03:14Z")

</div>

Hi! I’m trying to make a simple character just to test the input system and I’ve ran into some problems. Here’s what I’ve got.

PlayerCharacter.h

 ![347634-2021-08-30-08-57-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/7/0/e703dab85b35061d2dc4cbfc3662a612b04e7864.png)

PlayerCharacter.cpp

 ![347633-2021-08-30-08-57.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/e/3/ee3d5e3b8df9f0fb46f75fd19c72476df17d4583.png)

The compiler error I get:

 ![347635-2021-08-30-08-56.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/1/9/2191f72c82fd4c06c21821529a57b9ce35f43185.png)

 ![347636-untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/2/e/d2e00b607a9c3ea418ee822856b4b0814571ac9e.png)

My findings:  
After I remove line 36 from PlayerCharacter.cpp the character compiles so my wild guess would be that that’s what causing issues but I’m unable to figure out why.

---

<div class="post-metadata">

**Author:** ![DevinSherry](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/devinsherry/32/1101099_2.png) [@DevinSherry](https://forums.unrealengine.com/u/DevinSherry)\
**Post date:** [August 30, 2021, 7:09am UTC](https://forums.unrealengine.com/t/cant-get-a-character-to-compile-after-binding-a-key-to-the-inputcomponent/488176/2 "2021-08-30T07:09:22Z")

</div>

I found this thread that should be of use to you: [Why does BindKey cause Link error? - #2 by Pierdek](https://forums.unrealengine.com/t/why-does-bindkey-cause-link-error/35447/2).

It seems that you need to include some dependencies in your project.build.cs file, which is labeled as [YourProjectName.Build.cs] and should be found in your project’s root source folder.

In this file, there should be a section called PublicDependencyModuleNames.AddRange(new string[] {}); in this you should add ‘SlateCore’ and ‘Slate’ based on what this thread is saying. Here is an example of what mine looks like, as a reference.

```
  PublicDependencyModuleNames.AddRange(new string[] { "GameplayAbilities", "GameplayTags", "GameplayTasks", "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "UMG", "Slate", "SlateCore", "AIModule"});

```

I hope this helps, and good luck 🙂

---

<div class="post-metadata">

**Author:** ![DigitalCyan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DigitalCyan](https://forums.unrealengine.com/u/DigitalCyan)\
**Post date:** [August 30, 2021, 7:21am UTC](https://forums.unrealengine.com/t/cant-get-a-character-to-compile-after-binding-a-key-to-the-inputcomponent/488176/3 "2021-08-30T07:21:29Z")

</div>

That did the trick, tysm stranger.
