|
How do you compile an allegro program on Windows usings MSYS2 and MinGW? |
iheartcoffee
Member #16,518
August 2016
|
I'm a total newbie to Allegro and I was wondering, how do you issue a compile command to compile a program using Allegro 5? I do know how to compile using gcc. but how do you issue a command to gcc to statically link Allegro 5 so that the DLLs don't need to be distributed with the program?
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
Hello iheartcoffee, Here are a few tips for compiling with gcc. Some flags : -I include/directory -L link/directory -lLIBNAME You'll need to specify the include and linker search directories with -I and -L. Then you specify the link libraries with -l. To link with library libNAME.a you use -lNAME . The lib and .a are added automatically. The full list of static libraries for allegro 5 is as follows : -static -ljpeg -ldumb -lFLAC -ltheora -lvorbisfile -lvorbis -logg -lphysfs -lfreetype -lpng16 -lzlibstatic -ldsound -lgdiplus -luuid -lkernel32 -lwinmm -lpsapi -lopengl32 -lglu32 -luser32 -lcomdlg32 -lgdi32 -lshell32 -lole32 -ladvapi32 -lws2_32 -lshlwapi -static-libstdc++ -static-libgcc So first link to allegro : -lallegro_monolith-static and then the list above. Your final command will look like this : gcc -Wall -Wextra -Wshadow -pedantic -ansi -o Program.out -I c:\allegro\include main.c -L c:\allegro\lib -lallegro_monolith-static -static -ljpeg -ldumb -lFLAC -ltheora -lvorbisfile -lvorbis -logg -lphysfs -lfreetype -lpng16 -lzlibstatic -ldsound -lgdiplus -luuid -lkernel32 -lwinmm -lpsapi -lopengl32 -lglu32 -luser32 -lcomdlg32 -lgdi32 -lshell32 -lole32 -ladvapi32 -lws2_32 -lshlwapi -static-libstdc++ -static-libgcc
My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
ZoriaRPG
Member #16,714
July 2017
|
Hmm... I wasn't aware that you could build and not include an allegro lib of some kind with the binary. Why do you need to make a build without a library file in your distribution? I know that you can build Ag5 in monolithic, but your final binary still needs the mono-lib, even then. If it's possible to build a binary where all of the allegro library is embedded in one file, it's a new one for me.
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
ZoriaRPG said: If it's possible to build a binary where all of the allegro library is embedded in one file, it's a new one for me. Welcome to the future. It's called Static Linking. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Niunio
Member #1,975
March 2002
|
Edgar Reynaldo said: Welcome to the future. Future? It was the only way on DOS! ----------------- |
|