Advanced Sessions unresolved external symbol

Hello!

I added these lines in .Build.cs

PrivateDependencyModuleNames.AddRange(new string[] { "AdvancedSessions", "AdvancedSteamSessions"});
PrivateIncludePathModuleNames.AddRange(new string[] { "AdvancedSessions", "AdvancedSteamSessions"});

After that I can include classes from plugins, but when I call

auto NetId = FBPUniqueNetId();
UAdvancedSessionsLibrary::GetUniqueNetID(PlayerController, NetId);

I got unresolved external symbol error:

unresolved external symbol "public: static void __cdecl UAdvancedSessionsLibrary::GetUniqueNetID(class APlayerController *,struct FBPUniqueNetId &)" (?GetUniqueNetID@UAdvancedSessionsLibrary@@SAXPEAVAPlayerController@@AEAUFBPUniqueNetId@@@Z) referenced in function "public: static bool __cdecl USessionHelper::IsSession(class UObject *)" (?IsSession@USessionHelper@@SA_NPEAVUObject@@@Z)

Did I miss something or maybe I did something wrong?

1 Like

In UAdvancedSessionsLibrary, perhaps the function isn’t implemented in the cpp file or its using the wrong parameters?
And maybe you don’t need the private include paths but keep the private module dependencies? I’m still not that experienced in c++ so I may be wrong but I’m willing to help.

plugin’s class (still) is not marked for exporting from module. As said there, changing class definition to

UCLASS()
class ADVANCEDSESSIONS_API UAdvancedSessionsLibrary : public UBlueprintFunctionLibrary

will let your code compile