Compiling load81 on Mac OS X 10.7+ with brew

I use the great project ‘load81’ ( by Antirez (Redis fame) to work on algorithms on the road on my Pandora ( which is great fun and easy. Load81 allows you to code in the nice Lua language which is easy to learn and once mastered works on many platforms, especially if you are into game coding.

Normally I just send the code from the Pandora to github from which point the developer (a colleague or myself) can use the fleshed out algorithm to implement the required solution. 
This works well and so far I didn’t feel the need to execute the code on my macbook. Today that changed however; I finished a complete working game (WIP but working to show the algorithm and test the game play) and I wanted to test it on my macbook with my colleagues. 
I’m using brew here and your mileage may vary, but I did discover a snag
brew install pkg-config
brew install sdl 
brew install sdl_image
brew install sdl_gfx
git clone git://
cd load81
This resulted in an error; 

Package sdl was not found in the pkg-config search path.
Perhaps you should add the directory containing `sdl.pc’
to the PKG_CONFIG_PATH environment variable

Fixed with;
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
Another make resulted in the following error: 

framebuffer.h:7:23: error: SDL_image.h: No such file or directory

Which seemed to be a bug in the brew package; 
sudo nano /usr/local/lib/pkgconfig/SDL_image.pc
shows on line #1: prefix=/usr/local
which should be; 
After that  make works fine and you can use load81: 
./load81 examples/text.lua
Have fun!

Be the first to leave a comment. Don’t be shy.

Join the Discussion

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>