Reputation: 23
I created simple class, who implemented AActor. In this class i want get mouse position in game-dispaly. I know, that i must included 'Blueprint/WidgetLayoutLibrary.h' in *.cpp-file and in method 'Tick' write the following:
FVector2D mousePosition = UWidgetLayoutLibrary::GetMousePositionOnViewport(GetWorld());
so that every tick to get mouse position... BUT!!! I get an error:
Worlds_constantes.cpp.obj : error LNK2019: ??뫪? ?? ??ࠧ??襭??? ???譨? ᨬ??? "__declspec(dllimport) public: static struct FVector2D __cdecl UWidgetLayoutLibrary::GetMousePositionOnViewport(class UObject *)" (__imp_?GetMousePositionOnViewport@UWidgetLayoutLibrary@@SA?AUFVector2D@@PEAVUObject@@@Z) ? ?㭪樨 "public: virtual void __cdecl AWorlds_constantes::Tick(float)" (?Tick@AWorlds_constantes@@UEAAXM@Z).
C:\Users\user\Documents\Unreal Projects\Project_name\Binaries\Win64\UE4Editor-Project_name-6913.dll : fatal error LNK1120: ??ࠧ??襭??? ???譨? ??????⮢: 1
What to do? How to fix?
Upvotes: -1
Views: 3539
Reputation: 36
Maybe you have found the answer now, but this question has been bothering me for several days, so I decided to reply to you here, just add "UMG" in the specified position in Project.build.cs, maybe this question is too simple, there is almost no answer online.But for those who are just learning Unreal and C++, it is not known.
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore","UMG" });
Upvotes: 2