Building Allegro for FreeBSD

Posted Wednesday, February 20th 2013 in FreeBSD, Programming - Permalink

Allegro is a cross-platform game-programming library. It’s been around for a while; I used it to program my first video games in high-school back in 1999-2002. Compiling it for FreeBSD is pretty straight-forward once a few bugs are worked out.

You can get the source code for Allegro from the SourceForge page linked above. You can download an archive containing the latest stable version or get the source using Git. Either way, download the source, unpack it, and make a directory to build it in,

~/allegro # mkdir build
# cd build
# cmake ..
# make
# make install

If the build fails from problems finding X11 libraries, run the following commands to add the default third-party header and library locations:

setenv C_INCLUDE_PATH "/usr/local/include" 
setenv LIBRARY_PATH "/usr/local/lib"

This will add the paths necessary to find the headers and libraries.

Also, if you receive an error that says “/usr/include/malloc.h:3:2: error: #error “ has been replaced by “”, find any source files that reference “malloc.h” and replace that with “stdlib.h”.

List Posts Newest Posts Page 1Next Page