on Windows 64x, using steam api version 1.60 (the last one). With the following snippet, the game crashs on the function GetSteamID
if (SteamAPI_InitEx(nullptr)) {
if (SteamUser()) {
printf("SteamUser() is valid.n");
try {
CSteamID steamID = SteamUser()->GetSteamID();
printf("SteamID: %llun", steamID.ConvertToUint64());
} catch (const std::exception &e) {
printf("Exception occurred: %sn", e.what());
}
} else {
printf("SteamUser() is nullptr.n");
}
SteamAPI_Shutdown();
} else {
printf("Failed to initialize Steam API.n");
}
SteamUser()
is NOT null, as I can see "SteamUser() is valid.n"
. It is a valid ptr.
No exception, just a crash on that function GetSteamID()
With gdb, we can see in which function it crashes, which is the next function call after GetSteamID()
Thread 1 "MainThrd" received signal SIGSEGV, Segmentation fault. 0x00007ffa5a3de225 in steamclient64!Steam_NotifyMissingInterface () from C:Program Files (x86)Steamsteamclient64.dll
pointing my own steam client dll. It is up to date though.
I also tried using SteamAPI_Init()
and SteamAPI_InitFlat()
to load the API but I got the same result.
On Linux everything works fine.