Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Back for more...

This thread is locked; no one can reply to it. rss feed Print
Back for more...
Number Six
Member #3,912
October 2003
avatar

Well i've been gone for about 10 years but here I am again :)

Really happy to see the Allegro.cc is still here, and frankly stunned I remembered my username and password.

So i've not used Allegro in all this time and things have changed quite alot.
I used to compile in a terminal using gcc on Windows, Linux and Mac.

I've compiled and installed Allegro successfully on my Mac (I think!) but I'm damned if I can remember how to even compile/link my program with gcc and from a look of things that process is not quite the same as I vaguely remember it anymore.

Can anyone point me in the right direction? (God I'm a noob again...:P)

---------------------------------------
By Hook or by Crook.... We WILL!

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

If you're just using gcc, it's fairly straightforward.

gcc -Wall -Wextra -o proggie.exe -I $INCLUDE_DIR source1.cpp source2.cpp -L $LIB_DIR -l$ALLEGRO_LIBRARY

Just replace the $VAR with the appropriate directory or library.

-I sets the search directory for includes
-L sets the search directory for libs
-l links a library, where -lLIBNAME links to libLIBNAME.a .
-o sets the output filename
-Wall turns on most warnings
-Wextra turns on extra warnings

Additionally, you can specify -c to only compile objects and then link later, using your produced *.o files and libraries.

Static link needs a whole bunch of other libraries. I'm not sure what they are on OSX.

Number Six
Member #3,912
October 2003
avatar

Thanks for that - it got me off the ground. Unfortunately I seem to have a problem with one of the header files alplatf.h. Compiler says it is missing.

When I look where it is supposed to be there is a alplatf.h.cmake file - which suggests somehow it never got created.

I'm not sure on the way forward from here. Do I start over from scratch? - do I run cmake again?

Any help much appreciated

---------------------------------------
By Hook or by Crook.... We WILL!

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Number Six
Member #3,912
October 2003
avatar

I followed the build instructions included in the Allegro files so I:

1. Extracted the Allegro 5.2.1.1 files into a directory.
2. Changed into the Allegro directory and created a build sub directory.
3. Changed into the build directory and ran cmake ..
4. Ran make
5. Ran make install

All of this seemed to succeed but I don't know where make install put everything.
I can't find any Allegro libs or includes in the usual sorts of places such as in /usr/lib /usr/include, /usr/local/lib /usr/local/include etc

I was instead attempting to use the includes and lib files created in the build directory in my gcc invocation. However that one seems to not be there - There is only a version in a folder pertaining to iOS according to a system wide search which I assume is not suitable for Mac development use. It seems the cmake may not have been as successful as it seemed. I may have to start over from scratch. :(

---------------------------------------
By Hook or by Crook.... We WILL!

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Those are the correct directions to install allegro.

I don't know if cmake-gui comes on OSX, but you can set CMAKE_INSTALL_PREFIX to the directory where you want allegro to be installed. I think you set it like so :

cmake -G "GENERATOR" -DCMAKE_INSTALL_PREFIX=/usr/local ..

I was instead attempting to use the includes and lib files created in the build directory in my gcc invocation. However that one seems to not be there - There is only a version in a folder pertaining to iOS according to a system wide search which I assume is not suitable for Mac development use. It seems the cmake may not have been as successful as it seemed. I may have to start over from scratch. :(

This will fail because the header install process copies platform specific headers into the install directory that aren't in the build folder.

Go to: