I am trying to write a custom input device plugin. I am still trying to get the basic sample project to compile. Sadly the page about custom input devices and the custom input device plugin guide seem to be using slightly different example code, both outdated. I have gotten everything to build thus far, the only thing that keeps on failing is this line:
MessageHandler->OnControllerAnalog(FGamepadKeyNames::LeftTriggerAnalog, 0, 0.5f);
MessageHandler is a GenericApplicationMessageHandler and the OnControlerAnalog expects a FGamepadKeyNames::Type as the first argument. The example code passes EControllerButtons, but this seems to be outdated, as I can’t find any references to this and the code expects something different. Indeed FGamepadKeyNames also has a LeftTriggerAnalog etc., so I expect this to just be the successor interface.
Intellisense also has no problems with any of this, neither does the compiler itself. Instead, I get a LNK2001:
unresolved external symbol ""__declspec(dllimport) public: static class FName const FGamepadKeyNames::LeftTriggerAnalog" (__imp_?LeftTriggerAnalog@FGamepadKeyNames@@2VFName@@B)".
This seems to indicate to me that either InputCore is not correctly included as a dependency or that it does not export this symbol. I just can’t see why it would do that.
My build.cs clearly indicates it as a dependency:
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
"InputCore",
"InputDevice",
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
"InputCore",
"InputDevice",
}
);
I made sure that I include all the right headerfiles, but this too doesn’t change a thing (core.h is included anyways via the PCH, so none of this is really necessary):
#include "IInputInterface.h"
#include "GenericApplicationMessageHandler.h"
#include "InputCoreTypes.h"
I just can’t figure out what I am missing. I have tried anything anybody has done who posted even vaguely similar problems. Am I using the wrong type? Is this thing somehow not exported in the engine code? Am I missing some dependency? I really don’t know what I am doing wrong here.