|
Linking allegro statically |
Wizzlebach
Member #15,290
August 2013
|
Greetings, I wrote a simple game to get into Allegro on my Arch Linux machine. It runs all fine, but now when I want to distribute the game to a friend (uses Ubuntu) How do I link Allegro statically/ embed it into my executable so that it just runs without further dependencies? |
jmasterx
Member #11,410
October 2009
|
I've never done it on Linux, but, on Windows, before you compile allegro, go into the cmakelists txt and find the SHARED flag. It is ON, make it OFF. This will build a static link version of Allegro. Agui GUI API -> https://github.com/jmasterx/Agui |
Wizzlebach
Member #15,290
August 2013
|
Ah, I see. I'm using the precompiled version of allegro provided by the Arch community repository which happens to be static. I'll compile allegro myself then, thanks! |
Elias
Member #358
May 2000
|
A better way would be to also distribute the .so file. I usually do something like this: LD_LIBRARY_PATH=`pwd` game.bin And then I distribute game, game.bin and liballegro-monolith.so together in the same folder. Users can now simply run game and it works. -- |
jmasterx
Member #11,410
October 2009
|
That's a cool way to do it! Is there an advantage to distributing the .so other than the fact that you can replace the .so to update the game rather the the exe? Agui GUI API -> https://github.com/jmasterx/Agui |
|