Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Linux game publishing and shared / dynamic libraries

A topic by Teknologicus created May 14, 2023 Views: 411 Replies: 8
Viewing posts 1 to 6

I don't want to publish the Linux version of my game with a statically linked executable.  Is it considered good or bad form to bundle shared / dynamic libraries with one's game for better compatibility across Linux distros?

- Teknologicis

Moderator

...Why don't you want a statically linked executable. That's how you ensure maximum portability.

(1 edit)

I've had some issues with SDL2 and statically linking.  I'll see if I can resolve it.

Moderator

Oh, right. They don't like it, and make it hard. In that case, sure. But pretty much everyone is going to have SDL2 installed.

SDL2 seems to be an exception in linking troubles, especially in Debian repositories.

Moderator(+2)

There’s nothing wrong with linking dynamically and providing a copy of a library in your game. Windows does a similar with when .dll files are bundled.

However if you are using open-source libraries, make sure you follow their license. Some libraries require you to copy-paste their license in your project, so your users know that one library is not yours and is licensed under different terms than the rest of your project.

(+1)

Read about AppImage. Possibly the most comfortable way to make a linux application portable between different distributions.
https://www.appimage.org/


(+1)

I typically build on an old Debian distro. Put the binary in bin folder. Copy many of the libraries into the bin folder. I don't include glibc. Create a shell script that sets LD_LIBRARY_PATH and calls the bin executable.  I also include .itch.toml file to allow it to run from the itch app easily.

Appimages are not working on clean installs of Ubuntu I've heard. Flatpak are a good solution but you can't easily have it download the runtime I believe unless you put it on flathub.

Thank you!  I'll follow your suggestions with the next Linux build.