code-disaster / steamworks4j

A thin Java wrapper to access the Steamworks API
https://code-disaster.github.io/steamworks4j/
MIT License
468 stars 64 forks source link

Undefined symbol: SteamAPI_Init (Rebuild native libraries?) #136

Open dolda2000 opened 8 months ago

dolda2000 commented 8 months ago

I'm new to Steam, so I'm not really sure if this is something that changed with the Steamworks SDK recently or if I'm doing something wrong, but it looks like the former to me.

Trying to get some simple sample code running, I get the following error when running SteamAPI.init():

java: symbol lookup error: /tmp/lwjgl_fredrik/3.3.3-snapshot/x64/libsteamworks4j.so: undefined symbol: SteamAPI_Init

This is on Linux, in case it makes a difference. Looking at libsteam_api.so, it does indeed not have any SteamAPI_Init symbol. Rather, looking further at the include files in the SDK, SteamAPI_Init is now an inline function that only exists in the header files: From steam_api.h:

inline bool SteamAPI_Init()
{
    return SteamAPI_InitEx( NULL ) == k_ESteamAPIInitResult_OK;
}

I followed the instructions to rebuild the native libraries, and having done that, it now seems to work properly. Therefore, it seems to me that the native libraries that ship with the Git repo should be rebuilt and recommitted. I would do this myself, but I don't have access to a Windows or MacOS build environment.

dolda2000 commented 8 months ago

Having found the list of historical Steamworks SDKs for download, I found that this change was introduced in version 1.58a, currently the latest version.