rlabrecque / Steamworks.NET

Steamworks wrapper for Unity / C#
http://steamworks.github.io
MIT License
2.81k stars 368 forks source link

Steamworks cannot find DLL #530

Open campervcs934 opened 1 year ago

campervcs934 commented 1 year ago

Hi there! I'm using steamworks version 20.1.0 Unity version: 2021.3.13f1 (m1 version) OS: macOS Monterey 12.5 I've got an error when trying to initialize steam api

[Steamworks.NET] Could not load [lib]steam_api.dll/so/dylib. It's likely not in the correct location. Refer to the README for more details.
System.DllNotFoundException: steam_api assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) Steamworks.NativeMethods.SteamAPI_RestartAppIfNecessary(Steamworks.AppId_t)

I will be appreciated for any help!

cookie966507 commented 1 year ago

I had to go to the steamworks SDK and go to C:\Steam\steamworks_sdk_155\sdk\redistributable_bin\linux64 and copy the libsteam_api.so file into the mac build folder: Game Name.app\Contents\PlugIns

This seems to no longer to be copied when building anymore for some reason. I made my own script that copies it every time a build finishes. We had a crashing mac build on steam, then stopped once we copied over this one file and reuploaded.

@rlabrecque ^ not sure if you were aware of this or not

rlabrecque commented 1 year ago

Hmm, you should not be needing the .so file ever on OSX, so that's a little scary for multiple reasons. It should be using the steam_api.bundle and dylib inside it on osx from within: https://github.com/rlabrecque/Steamworks.NET/blob/master/com.rlabrecque.steamworks.net/Plugins

I wonder if you need to redownload the dylib like this person did?

https://github.com/rlabrecque/Steamworks.NET/issues/462#issuecomment-1051005021

cookie966507 commented 1 year ago

Ah you're right, only the dylib was needed. We only included the .so file because an older version of Steamworks appeared to add it to our build folder and I was trying to compare to a project that worked.

We also had crashing on the Steamdeck because of this, so once we can verify it is working on there as well, will comment.