So I've started implementing Steamworks functions for my game, and everything went perfectly fine. I managed to get sync with steam API ( i can do achievements and see that i'm playing game on my steam acc). However when i wanted to start using some functions that they provided, my engine is saying:
error LNK2019: unresolved external symbol
Anyone can help me solve this problem? I'm aiming atm at reading and saving score in Leaderboards. Any good advices for me ? :D
Code sample that gives me error:
int MyCodeLibrary::TryGetScore()
{
if (SteamAPI_Init())
{
CSteamLeaderboards obj();
obj().FindLeaderboard("test");
obj().DownloadScores();
return 0;
}
else
{
return 0;
}
}
Also tried to get to Steam with OnlineSubsystem like this:
void MyCodeLibrary::UpdateScoreInt(int score, FName board, APlayerController* PlayerController)
{
OutputDebugStringA("Funkcja jest wywoływana");
if (SteamAPI_Init())
{
OutputDebugStringA("Steam API działa");
ULocalPlayer* LocalPlayer = Cast<ULocalPlayer>(PlayerController->Player);
IOnlineSubsystem* ion = IOnlineSubsystem::Get(FName("Steam"));
TSharedPtr<const FUniqueNetId> UserId = ion->GetIdentityInterface()->GetUniquePlayerId(LocalPlayer->GetControllerId());
ion->GetLeaderboardsInterface();
FOnlineLeaderboardWrite wrt;
wrt.LeaderboardNames.Add(board);
wrt.SetIntStat(TEXT("Score"), score);
if (UserId.IsValid())
{
OutputDebugStringA("Mam UserID");
ion->GetLeaderboardsInterface()->WriteLeaderboards(board, *UserId, wrt);
printf("Odpalony score");
}
}
}