|
Compiling for windows from Linux with mingw: allegro.h no such file or directory |
dusthillresident
Member #16,778
December 2017
|
Hello, I'm writing a game using Allegro 4. I want to compile my game for windows so other people can play it. What I've tried doing so far: i686-w64-mingw32-gcc test.c -Iallegro-4.4.2/ -Lallegro-4.4.2/ -lalleg i686-w64-mingw32-gcc test.c -Lallegro-4.4.2/ -lalleg i686-w64-mingw32-gcc test.c -Iallegro-4.4.2/ -lalleg They all gave me the 'allegro.h not found' error. Then I tried changing to the allegro-4.4.2 directory and running this: i686-w64-mingw32-gcc test.c -Iinclude/ -lalleg This gave me a different error, include/allegro/internal/alconfig.h:36:44: fatal error: allegro/platform/alplatf.h: No such file or directory So just to see what would happen, I went and renamed alconfig.h.cmake to alconfig.h and then I got a screen full of messages like this: include/allegro/platform/alplatf.h:1:2: error: invalid preprocessing directive #cmakedefine #cmakedefine ALLEGRO_BCC32 Anyway, what should I do? Does anyone here have experience building allegro programs for windows targets on Linux systems? |
Edgar Reynaldo
Major Reynaldo
May 2007
|
You need more than the source code, and you need to point to -I allegro4.4.2/include for the headers. You need binaries, built yourself or by someone else with the exact same compiler. 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 |
dusthillresident
Member #16,778
December 2017
|
Thanks. How would I build the binaries? |
Edgar Reynaldo
Major Reynaldo
May 2007
|
With cmake-gui, ccmake, or cmake and mingw32-i686-make or whatever. 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 |
dusthillresident
Member #16,778
December 2017
|
There doesn't seem to be a make command specifically for mingw32. How would I tell 'make' to compile using the mingw equivalent gcc and other mingw tools? Edit: Edit: After a lot of trouble I got it to work. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
You have to install cmake, and make. 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 |
dusthillresident
Member #16,778
December 2017
|
After installing mingw in windows, I needed to install cmake. Then I worked out how to use cmakegui, I had to give it the paths to mingw's gcc and g++ commands. Then compiling allegro4 failed because some files related to DirectX had slightly wrong variable/constant names for some reason, so I had to manually search & replace until it compiled. Then I had to work out what command options I needed to give to gcc in order to make it compile my own game program. I eventually worked that out by looking at the CMakeList files for the example programs. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
I have binaries for Allegro 4.4.3 here : 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 |
|