Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Makefile error when installng allegro 4.2.3

Credits go to Edgar Reynaldo, push32, and raynebc for helping out!
This thread is locked; no one can reply to it. rss feed Print
Makefile error when installng allegro 4.2.3
Bob Keane
Member #7,342
June 2006

I am installing Allegro 4.2.3 on Fedora 29 and running into a problem. I ran fix.sh -unix and configure -- enable-static but get an error:

makefile:421: *** recipe commences before first target. Stop.
makefile:421: *** recipe commences before first target. Stop.

The makefile is attached. Google says there may be a space or missing / symbol on the line but I am not too familiar with makefiles. Can anyone else see the issue?

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

raynebc
Member #11,908
May 2010

Distros that have apt-get make this easier. "sudo apt-get install liballegro4-dev" worked flawlessly on Ubuntu the last time I tried it.

push32
Member #9,397
January 2008

Hi Bob,

I ran into the same problem when trying to compile Allegro 4.2.3 for DOS and Win32. The problem was the version of make, newer versions seem to be incompatible with the Makefile. Make version 3.79 worked for me.

Best regards,
Torsten

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Bob Keane
Member #7,342
June 2006

Torsten said:

I ran into the same problem when trying to compile Allegro 4.2.3 for DOS and Win32. The problem was the version of make, newer versions seem to be incompatible with the Makefile. Make version 3.79 worked for me.

Best regards,
Torsten

Thanks, I'll give it a go.

<edit> Installing make 3.79 got me past the configure issue but when running make I get another error:

make: *** [obj/unix/asmdef] Error 1

I don't want to run all over the internet looking up errors. Two questions: Will downloading from Git install the version of allegro I want with all the dependencies? If so, I have never used git before. Where can I find a step by step guide to do so?

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Bob Keane
Member #7,342
June 2006

I downloaded allegro-4.2.2-xc-master, ran fix.sh but get an error: bash: ./configure: No such file or directory. I guess I'll try to find a guide to Allegro . Thanks anyway.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Why do you want version 4.2.2? 4.4 is the latest for the 4 branch and it builds with cmake. This isn't as hard as you're making it.

There are four add-ons, logg, jpgalleg, loadpng, and allegroGL. These need ogg, vorbis, and libpng and zib. These are all optional.

Bob Keane
Member #7,342
June 2006

I don't really need version 4.2, I'm just looking for one with good documentation. I have that book which covers 4.0.3, but I can't get it to install.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

4.4 is src compatible with 4.2 and 4.0.

Minus like two deprecated functions.

EDIT
ZLib and LibPNG build with CMake. Ogg and Vorbis build with configure. Allegro 4.4 builds with cmake.

By all means, use your package manager, and search for the dependencies. I'm more than sure those 4 libraries are provided.

Then you build Allegro 4.4.

It's easy.

1) download allegro src using git
2) copy to allegro folder somewhere
3) open a terminal in that folder
4) mkdir build
5) cd build
6) cmake -G "Unix Makefiles" ..
7) make
8) make install
9) $$$PROFIT$$$

Bob Keane
Member #7,342
June 2006

Well I got Allegro to install but am having trouble linking with the --pkgconfig files. Guess I have more searching to do.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Bob Keane
Member #7,342
June 2006

That works, but now I have to figure out why it does not find the allegro.h file.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Bob Keane
Member #7,342
June 2006

We are getting closer. Using gcc -Iinclude /usr/local/include/allegro.h -o main `allegro-config --cflags --libs` gives me an "undefined reference to main" error.

Here is the code:

#SelectExpand
1#include <allegro.h> 2 3 4 int main() 5 6 { 7 8 //Initialize Allegro 9 10 allegro_init(); 11 12 13 14 //Set the resolution to 640 x 480 with SAFE autodetection. 15 16 set_gfx_mode(GFX_SAFE, 640, 480, 0, 0); 17 18 19 20 //Install the keyboard handler 21 22 install_keyboard(); 23 24 25 26 //Print your welcome message to the screen 27 28 textout(screen, font, "Hello Dream.In.Code! This is my first Allegro Program", 1, 1, 10); 29 30 textout(screen, font, "Press ESCape to quit.", 1, 12, 11); 31 32 33 34 //Loop until escape is pressed 35 36 while(! key[KEY_ESC]) 37 38 poll_keyboard(); 39 40 41 42 //Exit program 43 44 allegro_exit(); 45 46 return 0; 47 48 }

I remember seeing the problem before but cannot remember the solution. It was something simple.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

The correct line would be something more like this :

gcc -Wall -Wextra -Wshadow -o program `allegro_config --cflags` main.c `allegro_config --libs`

Or specifying manually :

gcc -Wall -Wextra -Wshadow -o program -I //usr/local/include main.c -L //usr/local/lib -lalleg

You forgot to specify the source file.

Peter Hull
Member #1,136
March 2001

I can't remember if you need END_OF_MAIN on Linux. You might need it.

Also why not dnf install allegro-devel I've given up compiling allegro myself, unless I need to.

Good luck!

Bob Keane
Member #7,342
June 2006

That worked, thanks Edgar. However, for future generations, I would like to say it should be allegro-config, not allegro_config. Peter, I tried using dnf, but I think I had the wrong package name. Maybe next time.

By reading this sig, I, the reader, agree to render my soul to Bob Keane. I, the reader, understand this is a legally binding contract and freely render my soul.
"Love thy neighbor as much as you love yourself means be nice to the people next door. Everyone else can go to hell. Missy Cooper.
The advantage to learning something on your own is that there is no one there to tell you something can't be done.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

ZoriaRPG
Member #16,714
July 2017
avatar

4.4 is src compatible with 4.2 and 4.0.

Minus like two deprecated functions.

4.4 also needed some tweaks in the programme src, for us, for packfile password calls, and some stuff for glibc 2.28.

https://github.com/ArmageddonGames/ZeldaClassic/blob/2.55/src/alleg_compat.h
https://github.com/ArmageddonGames/ZeldaClassic/blob/2.55/src/allegro_wrapper.h
https://github.com/ArmageddonGames/ZeldaClassic/blob/2.55/src/alleg_compat.cpp

In the event that you run into a similar situation.

Go to: