OnlineSub = IOnlineSubsystem::Get(STEAM_SUBSYSTEM);
if (!OnlineSub)
{
// 执行其他初始化操作
return;
}
SteamSub = static_cast<FOnlineSubsystemSteam*>(OnlineSub);
FOnlineAuthSteamPtr OnlineAuthSteamPtr = SteamSub->GetAuthInterface();
OnlineAuthSteamPtr->AuthenticateUser(*UniqueNetId.Get().);
Build.cs
PrivateDefinitions.Add(“ONLINESUBSYSTEMSTEAM_PACKAGE=1”);
Message:
“I’ve set PrivateDefinitions.Add(“ONLINESUBSYSTEMSTEAM_PACKAGE=1”); in .Build.cs, but it’s still throwing an error.”
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"HTTP",
"Json",
"OnlineSubsystem",
"OnlineSubsystemSteam",
"Steamworks",
// ... add other public dependencies that you statically link with here ...
}
);
AddEngineThirdPartyPrivateStaticDependencies(Target, “Steamworks”);
无法解析的外部符号 “public: bool __cdecl FOnlineAuthSteam::AuthenticateUser(class FUniqueNetId const &)” (?AuthenticateUser@FOnlineAuthSteam@@QEAA_NAEBVFUniqueNetId@@@Z),函数 “public: void __cdecl USteamSubsystem::OnAuthSteam(void)” (?OnAuthSteam@USteamSubsystem@@QEAAXXZ) 中引用了该符号