Godotsteam: Fix for 'error while loading shared libraries: libsteam_api.so' | Fedora 32 and Manjaro

Created on 20 Oct 2020  Â·  7Comments  Â·  Source: Gramps/GodotSteam

Description

After you add libsteam_api.so to the directory of the editor binary (as suggested on the GodotSteam site), the editor launches and you can also run your game from the project selector. However, once inside the editor, trying to launch the game (pressing F5 or otherwise) fails with

error while loading shared libraries: libsteam_api.so: cannot open shared object file: No such file or directory

It appears that this is due to the game trying to find libsteam_api.so somewhere other than where the editor is looking.

Fix

Fix tested on both Fedora 32 and Manjaro, however they differ so I'll include them both (both systems have Steam installed).
Manjaro - run sudo cp libsteam_api.so /usr/lib/
Fedora 32 - run sudo cp libsteam_api.so /lib64/

from the directory where your library is located. The library needs to be in both the GodotSteam binary directory, as well as in the lib one. In order to find where the game might try look for the library on your system, you can use the ldd <bin path here> to find out. Then you can copy the libsteam_api.so there.

linux

Most helpful comment

I know this issue is closed but you need your LD_LIBRARY_PATH to include the bin directory in your root godot folder.
Also, a better way than moving libsteam_api to your system library directories would be to move libsteam_api to your projects root directory. Moving them system wide just screams for problems down the road after you've forgotten about it and no packages have tracked them going there. However, using this script, you shouldn't need to move then anywhere. Being in the bin directory and launching godot with this script should be enough.

This is the script which is based on what Godot says about launching Godot on GNU/Linux in their documentation:

#!/bin/bash

HELP_STRING="-v - Run Godot with the --verbose option."
verbose=""

while getopts hv flag
do
        case "${flag}" in
        h) help=
            echo $HELP_STRING
            exit
        ;;
                v) verbose=--verbose;;
        esac
done

export LD_LIBRARY_PATH="$PWD/bin/"
./bin/godot.x11.opt.tools.64 $verbose

If I'm misreading this issue, sorry.

All 7 comments

This is true and has come up in the past. If I remember correctly this has something to do with how Steam installs on different Linux flavors. Or, perhaps, by how Steam is installed. Which is why the libsteam_api.so is missing in specific folders that it should be in by default. This issue seems to affect Steam generally on Linux, for some folks, and other non-Godot games.

That being said, thanks for writing this up! I will add this to the documentation.

OK, that information has been added to a new Linux Caveats tutorial which outlines this conversation and some others about this particular issue. It will also serve as a place to put further weird Linux quirks if/when we come across them. You were also mentioned in the tutorial along with your suggested lines of code! Thanks again!

Glad to help!

I know this issue is closed but you need your LD_LIBRARY_PATH to include the bin directory in your root godot folder.
Also, a better way than moving libsteam_api to your system library directories would be to move libsteam_api to your projects root directory. Moving them system wide just screams for problems down the road after you've forgotten about it and no packages have tracked them going there. However, using this script, you shouldn't need to move then anywhere. Being in the bin directory and launching godot with this script should be enough.

This is the script which is based on what Godot says about launching Godot on GNU/Linux in their documentation:

#!/bin/bash

HELP_STRING="-v - Run Godot with the --verbose option."
verbose=""

while getopts hv flag
do
        case "${flag}" in
        h) help=
            echo $HELP_STRING
            exit
        ;;
                v) verbose=--verbose;;
        esac
done

export LD_LIBRARY_PATH="$PWD/bin/"
./bin/godot.x11.opt.tools.64 $verbose

If I'm misreading this issue, sorry.

@nuggs You, sire, were not misreading the issue and this is the kind of script I was talking about... though I think I mention it in a related, yet different, thread. Definitely bypasses the need to symlink or copy the libsteam_api into the system folders. And the libsteam_api should always be in your project's root directory. Which, I think and hope, is in the GodotSteam documentation.

Speaking of, do you mind if I include this script in the Linux Caveats tutorial? With proper crediting to you, of course.

Ultimately it would be best if Valve could fix the Linux Steam installer to put the libsteam_api in the correct places every time but alas we must sometimes fall back to these measures. On various installations, I have had everything work great 90% of the time with a few times having to resort to one of the methods discussed.

Go ahead and use the script, no credit is needed. Only thing I did was add the verbose stuff. Credit the Godot documentation, they did a good job. :D

OK, I'll get it added; perhaps also as a download or something. Well, I'll credit you and the Godot documentation. Seems fitting. Thanks again!

UPDATE: And done! The new solution is added to the Linux Caveats tutorial page.

Was this page helpful?
0 / 5 - 0 ratings