libsteam_api.so not found

Started by statto, April 20, 2024, 00:28:20

Previous topic - Next topic

statto

Compiling on Linux. What's the proper place to put libsteam_api.so, or how to I tell the compiler where it is? I'm using MaxIDE and am getting a file not found error. Thanks in advance!

William

#1
what module your using and how it's supposed to be setup?. I imagine in your app code it is supposed load the library there should be a load function like dlls that can load the .so or .dlls library. Blitzmax right?

Let me explain, I'm trying to explain it is something like including a line of code in your app source code like loadlibrarya("./library.so") and then using the libraries functions.

./ Means from current or present directory
im still interested in oldschool app/gamedev

statto

Just the generic Steam module.

My error was using Import instead of Framework, but it still doesn't compile due to a zip error.

dawlane


That is not a lot of information to go on. What type of error, is it a link error, or something else.

statto

Fair, I thought I had solved the first issue.

On linux I'm running into a:
in function `_bb_main':
.bmx.gui.release.linux.x64.c:(.text+0x10acc4): undefined reference to `__bb_archive_gzip_gzip'
collect2: error: ld returned 1 exit status

I'm not even sure this is a Steam error, and this is a very complex piece of software that I'm exploring adding Steam Deck support to, but the only change between this and the production version is the Framework line.

dawlane

A link error.
First make sure that you actually have the required Linux development files installed for dealing with compression libraries.
Make sure that you have the BlitzMax module installed and built that binds to the compression libraries.

You will need to read up on the linking mechanisms that Linux employs for shared libraries.
The most common one for application distribution is setting the applications RPATH to point to a sub directory within the applications home folder.
Other methods involve using a start up script to set and export the LD_LIBRARY_PATH variable.

https://opensource.com/article/20/6/linux-libraries
https://amir.rachum.com/shared-libraries/

William

alright but if you dont know already doing framework of the steam module in blitzmax uses that module exclusively and if that is the case case you need to import the other modules you wish to use in your app
im still interested in oldschool app/gamedev

Derron

#7
@William
Only brl.mod and pub.mod are imported by default (if no framework is used). So statto would need to explicitely import the steam module:
https://github.com/bmx-ng/steam.mod

If they don't then they will have to import the .so file (on linux) on their own - and also create the links to the functions there (that is what is done inside of the "extern" function definitions).


The linker error tells that something got compiled with a reference to `__bb_archive_gzip_gzip` - which, when "unmangling", says there is an "archive.mod/gzip.mod/..." somewhere.
If statto uses "Framework" they now need to ensure to also import this module then.

import archive.gzip


Edit: This should only be an issue if:
- some C code somehow references this function directly (so assuming you import things and relying on the "mangling" naming conventions NG currently goes through)
- some blitzmax module code one fetched from somewhere which somehow is not recompiled ("quick scan" etc) and thus no error is catched
- application code and a "quick scan + quick" build which does not recompile and the precompiled code contains these references

The last 2 points would normally be catched by BlitzMax if the blitzmax sources would have to be compiled - which as said might not have been happening. Ensure that corresponding code is recompiled until you get your code actually working/compiling/linking/executing.
 

bye
Ron

statto

Thanks for the help!

I had imported archive.GZip as a framework for some reason, changing it from Framework to Import it again got us back to square one - libsteam_api.so not found.

I think the thing I'm struggling with is that it's literally in the /steamsdk.mod/sdk/redistributable_bin/linux64 folder AND in the folder with the code. I've just re-built all of the modules and don't compile with quick scan, and I'm still unsure of how to tell the compiler to look in redistributable_bin here. I may give up and just ?win32 this, but I do greatly appreciate everyone's response.

Derron

I can replicate it with the steamsdk.mod/example/example_01.bmx

I also played with the module info part there:
ModuleInfo "LD_OPTS: -L%PWD%/sdk/redistributable_bin/linux64"
ModuleInfo "LD_OPTS: -Wl,-rpath,'$ORIGIN'"

and removing that first line leads to another issue (-lsteam_api not found  - during linking already).
With the current code it generates the binary but this one fails to find the file.

Quote$ ldd example_01
   linux-vdso.so.1 (0x00007ffd68bb0000)
   libsteam_api.so => not found
   libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0a658e3000)
   libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0a656ba000)
   libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0a655d3000)
   /lib64/ld-linux-x86-64.so.2 (0x00007f0a65b31000)
   libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f0a655b3000)

bye
Ron

Derron

#10
If you run it from a shell script (start.sh) or from the terminal, it finds it:

$ LD_LIBRARY_PATH=.
$ export LD_LIBRARY_PATH
$ ./example_01
[S_API] SteamAPI_Init(): SteamAPI_IsSteamRunning() did not locate a running instance of Steam.
[S_API] SteamAPI_Init(): Loaded '/home/ronny/.steam/linux64/steamclient.so' OK.
[S_API FAIL] SteamAPI_Init() failed; create pipe failed.Steam is not running

(I do not have steam running as I only used it 1-2 within years)

I guess this is not something the steamsdk.mod-module has to/is able to tackle but you as application developer.

bye
Ron