Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of documentation regarding shared libraries #163

Open
tropical32 opened this issue Mar 14, 2024 · 1 comment
Open

Lack of documentation regarding shared libraries #163

tropical32 opened this issue Mar 14, 2024 · 1 comment

Comments

@tropical32
Copy link

tropical32 commented Mar 14, 2024

README.md lacks documentation regarding the integration of shared libraries. While executing a simple example using cargo run works seamlessly, building the project and executing the resulting binary leads to errors due to missing shared libraries. For instance:

$ target/release/steam_works                                                                  
target/release/steam_works: error while loading shared libraries: libsteam_api.so: cannot open shared object file: No such file or directory

Even manually copying the shared object to ./target/release does not resolve the issue. There's no clear indication or documentation provided on how to properly handle shared libraries or which global variables to update for it to work.

I found that moving libsteam_api.so to /lib supressed that error:
sudo cp libsteam_api.so /lib

In windows, steam_api64.dll should live in C:\Windows\system32

@tropical32 tropical32 changed the title Lack of Documentation Regarding Shared Libraries Lack of documentation regarding shared libraries Mar 14, 2024
@honungsburk
Copy link

honungsburk commented Mar 27, 2024

After some digging I discovered that you can create a launch script on Linux and include libsteam_api.so in the same folder as your binary. Note that the script must be made executable with chmod +x launch_script.sh

The "$@" passes the arguments to the script to your application

#!/bin/sh

export LD_LIBRARY_PATH="."
./your-application "$@"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants