GLUI, GLUT, and Mac OS X… Oh my!
I needed GLUI to do an assignment but I found that it wouldn’t compile on Mac OS X. Here’s what I did to make it work. Hopefully someone will find this with google and it will save them some time. I used GLUI 2.35 and Mac OS X 10.4.8.
Update: My original solution didn’t work on my new Intel-based MacBook Pro, so I’ve updated the instructions below so that they should work for either PowerPC or Intel macs.
Update #2: I got so fed up with this crap that I just made a GLUI Framework which works much nicer with XCode. If you still want it as a libglui.a file, then read on…
First, you have XCode installed, right?
Open the Makefile and change the line:
LIBGL = -lGLU -lGL
to
LIBGL = -framework OpenGL
and
LIBGLUT = -L/usr/X11R6/lib -lglut
to
LIBGLUT = -L/usr/X11R6/lib -framework GLUT
This assumes you have GLUT.framework installed which you probably do. It should be in /System/Library/Frameworks/. If not, you can download it and install it yourself.
Then build like usual…
pb:~/glui-2.35/src lcyca$ make mkdir -p bin mkdir -p lib g++ -I./ -I./include -I/usr/X11R6/include -c glui_string.cpp g++ -I./ -I./include -I/usr/X11R6/include -c glui.cpp ... ... (lots of output)
Then you can try out the included examples. Since the mac version of GLUT doesn’t use X11, you can run them straight from Terminal.app.
pb:~/glui-2.35/src lcyca$ cd bin pb:~/glui-2.35/src/bin lcyca$ ./example5
If you want to actually install it, copy lib/libglui.a to /usr/local/lib/ and include/GL/glui.h to /usr/local/include/GL/, because software that requires it is most likely to be looking for it there.
pb:~/glui-2.35/src lcyca$ mkdir /usr/local/lib pb:~/glui-2.35/src lcyca$ cp lib/libglui.a /usr/local/lib/ pb:~/glui-2.35/src lcyca$ mkdir /usr/local/include pb:~/glui-2.35/src lcyca$ cp include/GL/glui.h /usr/local/include/
4 Comments so far
Leave a reply

Are you the Matrix?
Awesome mate … thanks for that …. VERY helpful.
Hi, I’m desperately trying to get my glui code to compile in Xcode. failed miserably all day, quite frustrated! I cant quite see what you’re doing here with this, could you possibly explain to me further - your site seems the only one with anything remotely like good advice!
My code all works fine on linux but when I just installed Xcode on my new mac this morning I put all my files into a project, added the openGL and GLUT frameworks accordingly, and then installed glui and added glui.h to my project. It cant seem to really find it - compiles fine but when i run it says no GLUI_master which is defined in glui.h and associated files. I didnt quite get what you were saying about where I should put the glui-2.35 folder - at the mo its in my project folder and still not working!
your help would be very much appreciated! starting to lose faith in macs rapidly!
Kate
I couldn’t use your framework because there’s a part of glui which uses ftime which doesn’t exist on 10.3.9 but does in 10.4. I made a post about what I did to get it working. Thanks for your help. http://www.idevapps.com/forum/showthread.php?t=2751