Building Binaries For Multiple Distros

As an open source game developer, I’ve generally not built binaries for Linux. I’d build them for Windows but for Linux it is either provided by your distro or you build it yourself. Obviously flatpaks and snaps can also be used. I decided to build a binary for Anagramarama so that a user group member using Ubuntu could try it out.

First I built it on Fedora 35 and copied all libraries except libc and libm. I put all the libs in a subdirectory and then moved anything missing into the bin directory and added a script to set LD_LIBRARY_PATH. This failed of course because glibc on Fedora is newer than Ubuntu. I knew the recommendation is to compile with the oldest system you want to support.

I started Fedora 32 in a VM and did the same as before. (Why 32? It was the first release with libgamerzilla.) It mostly worked. It worked on Fedora 35 and 32. It ran on Ubuntu 20.04 but crashed after switching the screen resolution when going fullscreen.

Sometimes you can copy the libraries into the same directory as the main binary. Then you don’t have to mess with LD_LIBRARY_PATH and the application/game will use the local library file even if one by the same name exists elsewhere in the system.

For the missing binaries, I’d probably create a separate directory for them somewhere and then add that directory to the front of PATH rather than mixing them in with things in the system bin directories.

Just my 2¢.

Edit: Of course none of that is likely to help with your problem of the game crashing when switching screen resolutions. That sounds more like a problem with the video driver.

Not to my knowledge. Windows typically has “.” in the PATH variable which allows that. I don’t know of any Linux distro which adds “.” to LD_LIBRARY_PATH.