How do I use SystemParametersInfoW function?

I need to call this Windows function SystemParametersInfoW and

#include "Windows/AllowWindowsPlatformTypes.h"
#include <Windows.h>
#include "Windows/HideWindowsPlatformTypes.h"

includes. But I’m getting

WallpaperActor.cpp.obj : error LNK2019: unresolved external symbol __imp_SystemParametersInfoW referenced in function "private: class FString __cdecl AWallpaperActor::GetDesktopWallpaperPath(void)" (?GetDesktopWallpaperPath@AWallpaperActor@@AEAA?AVFString@@XZ)
WallpaperActor.cpp.obj : error LNK2019: unresolved external symbol "public: bool __cdecl IImageWrapper::GetRawImage(struct FImage &)" (?GetRawImage@IImageWrapper@@QEAA_NAEAUFImage@@@Z) referenced in function "private: class UTexture2D * __cdecl AWallpaperActor::LoadTextureFromFile(class FString const &)" (?LoadTextureFromFile@AWallpaperActor@@AEAAPEAVUTexture2D@@AEBVFString@@@Z)

errors I cannot fix. I guess I need to add some module to my *.Build.cs file, but how do I know which one?

Solution: I had

PublicAdditionalLibraries.Add("User32.lib");

in my Build.cs file, but actually it was not loaded because for some reason UBT was not able to find it. So I just used the full path like:

PublicSystemLibraries.Add("C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.26100.0\\um\\x64\\User32.Lib");

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.