code-disaster / steamworks4j

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

Crashes while loading native libs #54

Closed Osaris31 closed 7 years ago

Osaris31 commented 7 years ago

Hi,

In the latest snapshot, there seems to be a problem in the way libs are loaded on linux. The function "isSdkLibName" is used even when the sdk path is not used, and this leads to never have 64 in the getPlatformLibName on linux. So when not using the sdk, the 32 bit version is used instead of 64 bit and the game crash: java.lang.UnsatisfiedLinkError: /tmp/steamworks4j/1.7.0-SNAPSHOT/libsteam_api.so: /tmp/steamworks4j/1.7.0-SNAPSHOT/libsteam_api.so: неправильный класс ELF: ELFCLASS32 (Possible cause: architecture word width mismatch)

Another problem, in windows, some antivirus block the use of extracted libs: Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.UnsatisfiedLinkError: C:\Users\antho\AppData\Local\Temp\steamworks4j\1.7.0-SNAPSHOT\steam_api64.dll: Access is denied at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(Unknown Source) Caused by: java.lang.UnsatisfiedLinkError: C:\Users\antho\AppData\Local\Temp\steamworks4j\1.7.0-SNAPSHOT\steam_api64.dll: Access is denied

So, it would be great to have a option to not extract the lib and simply read it from a folder where it is put on game install.