[quote=“4ugui, post:2155, topic:30020”]
Try to compile in Visual Studio 2017
if (UAdvancedSessionsLibrary::HasOnlineSubsystem(FName(TEXT(“Steam”))))
{
SteamIcon->SetVisibility(ESlateVisibility::Visible);
PlayerSteamName->SetVisibility(ESlateVisibility::Visible);
FString PlayerName;
UAdvancedSessionsLibrary::GetPlayerName(this->GetOwningPlayer(), PlayerName);
PlayerSteamName->SetText(FText::FromString(PlayerName));
FBPUniqueNetId UniqueNetId;
UAdvancedSessionsLibrary::GetUniqueNetID(this->GetOwningPlayer(), UniqueNetId);
EBlueprintAsyncResultSwitch Res;
UTexture2D* AvatarIcon = UAdvancedSteamFriendsLibrary::GetSteamFriendAvatar(UniqueNetId, Res, SteamAvatarSize::SteamAvatar_Medium);
SteamIcon->SetBrushFromTexture(AvatarIcon);
}
Got link errors:
Creating library C: est\FutureRPG\Intermediate\Build\Win64\UE4Editor\Development\FutureRPG\UE4Editor-FutureRPG.suppressed.lib and object C: est\FutureRPG\Intermediate\Build\Win64\UE4Editor\Development\FutureRPG\UE4Editor-FutureRPG.suppressed.exp
1>MainMenuWidget.cpp.obj : error LNK2019: unresolved external symbol “public: static class UTexture2D * __cdecl UAdvancedSteamFriendsLibrary::GetSteamFriendAvatar(struct FBPUniqueNetId,enum EBlueprintAsyncResultSwitch &,enum SteamAvatarSize)” (?GetSteamFriendAvatar@UAdvancedSteamFriendsLibrary@@SAPEAVUTexture2D@@UFBPUniqueNetId@@AEAW4EBlueprintAsyncResultSwitch@@W4SteamAvatarSize@@@Z) referenced in function “protected: virtual void __cdecl UMainMenuWidget::NativeConstruct(void)” (?NativeConstruct@UMainMenuWidget@@MEAAXXZ)
1>MainMenuWidget.cpp.obj : error LNK2019: unresolved external symbol “public: static void __cdecl UAdvancedSessionsLibrary::GetUniqueNetID(class APlayerController *,struct FBPUniqueNetId &)” (?GetUniqueNetID@UAdvancedSessionsLibrary@@SAXPEAVAPlayerController@@AEAUFBPUniqueNetId@@@Z) referenced in function “protected: virtual void __cdecl UMainMenuWidget::NativeConstruct(void)” (?NativeConstruct@UMainMenuWidget@@MEAAXXZ)
1>MainMenuWidget.cpp.obj : error LNK2019: unresolved external symbol “public: static void __cdecl UAdvancedSessionsLibrary::GetPlayerName(class APlayerController *,class FString &)” (?GetPlayerName@UAdvancedSessionsLibrary@@SAXPEAVAPlayerController@@AEAVFString@@@Z) referenced in function “protected: virtual void __cdecl UMainMenuWidget::NativeConstruct(void)” (?NativeConstruct@UMainMenuWidget@@MEAAXXZ)
1>MainMenuWidget.cpp.obj : error LNK2019: unresolved external symbol “public: static bool __cdecl UAdvancedSessionsLibrary::HasOnlineSubsystem(class FName)” (?HasOnlineSubsystem@UAdvancedSessionsLibrary@@SA_NVFName@@@Z) referenced in function “protected: virtual void __cdecl UMainMenuWidget::NativeConstruct(void)” (?NativeConstruct@UMainMenuWidget@@MEAAXXZ)
1>C: est\FutureRPG\Binaries\Win64\UE4Editor-FutureRPG.dll : fatal error LNK1120: 4 unresolved externals
My Build.cs
PrivateDependencyModuleNames.AddRange(new string]
{
“AdvancedSessions”,
“AdvancedSteamSessions”
});
What i miss?
Thank you!
Hello!
I have same issue, did u solve this problem?