Drachenfrucht1 / godotcord

A Discord Game SDK integration for Godot
https://drachenfrucht1.github.io/godotcord
MIT License
53 stars 5 forks source link

Error loading shared libraries on Linux #22

Closed jordi-star closed 3 years ago

jordi-star commented 3 years ago

After removing all parts of the GameSDK that use std:: (for example std::int32_t becomes int32_t) and adding using namespace std; to types.h (to fix #20), the engine compiles successfully. But when I try to run an empty scene in an empty project, I get the following error: image Even though the file structure is correct: image

Drachenfrucht1 commented 3 years ago

I think the error occurs because the godot instance that runs the scene isn't opened from the executable directory. An easy fix is to modify the rpath of the executable by running patchelf --set-rpath '$ORIGIN' path/to/godot/executable (similar to the last step for compilation on mac OS). I am currently trying to set the rpath correctly at compile time but nothing has worked so far.

Drachenfrucht1 commented 3 years ago

No, from my testing, a relative path in rpath is interpreted from the location the binary is executed. So if the rpath is set to ./ and I execute bin/godot.x11.opt.tools.64, only ./ would be searched for the shared binary but not ./lib. $ORIGIN is replaced with the location of the binary not matter where I execute it. So when executing bin/godot.x11.opt.tools.64, ./bin would be searched for the shared library

jordi-star commented 3 years ago

Yeah I got it, Godot now successfully plays the scene without the error mentioned above, but I'm testing the Activity Manager and it's not working for me atm. Most likely not a problem related to this though so I'll see if I can get it sorted out.

jordi-star commented 3 years ago

In the mean time can you look into merging #24 and #23