I tried to implement the code of a friend from IRC, the original code of him is here: http://hastebin.com/otaranepuc.cpp
Here’s my version: http://www.fpaste.org/186506/17963114/raw/
My code after compilation shows those errors in Visual Studio 2013:
Error 1 error LNK2019: unresolved external symbol “__declspec(dllimport) class UScriptStruct * __cdecl Z_Construct_UScriptStruct_FKeyEvent(void)” (_imp?Z_Construct_UScriptStruct_FKeyEvent@@YAPEAVUScriptStruct@@anonymous_user_9674a66c) referenced in function “class UFunction * __cdecl Z_Construct_UFunction_UKeybindingBlueprintLibrary_GetKeybindForEvent(void)” (?Z_Construct_UFunction_UKeybindingBlueprintLibrary_GetKeybindForEvent@@YAPEAVUFunction@@anonymous_user_9674a66c)
*\ProjectFiles\CarCarCar.generated.cpp.obj CarCarCar
Error 2 error LNK1120: 1 unresolved externals *\game\Binaries\Win64\UE4Editor-CarCarCar.dll CarCarCar
Error 3 error : Failed to produce item: *\UE4Editor-CarCarCar.dll *\game\Intermediate\ProjectFiles\ERROR CarCarCar
Check if InputCore is in your module build file (CarCarCar.Build.cs)
Thats the content of the file:
// Fill out your copyright notice in the Description page of Project Settings.
using UnrealBuildTool;
public class CarCarCar : ModuleRules
{
public CarCarCar(TargetInfo Target)
{
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
PrivateDependencyModuleNames.AddRange(new string[] { });
// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
// Uncomment if you are using online features
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
// if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
// {
// if (UEBuildConfiguration.bCompileSteamOSS == true)
// {
// DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
// }
// }
}
}
I was off. You need to add SlateCore to the module names.
Change that part:
// Uncomment if you are using Slate UI
PrivateDependencyModuleNames.AddRange(new string[] { "SlateCore" });
The reason is this: FKeyEvent is defined in the SlateCore module.
If you encounter this error or a smiliar one in the future look out for the symbol name in the error message “Z_Construct_UScriptStruct_FKeyEvent” and find out where it is defined. Most of the times the module name is Engine/Source/Runtime/ModuleName or Engine/Source/Editor/ModuleName
Thank you it works now. Can you please convert your comment to a question, so I can mark it as solved? Thanks again mate, you safed my day!