View Full Version : trying to build app using glut

08-07-2007, 07:53 PM
I downloaded a nehe demo and tried to build under Mac OS 10.4 (intel)
I'm building using g++ 4.0.1, and since the demo used code warrior, and had no makefile, I have no idea what it did, but since I know how to build on Linux and Windows, I figured it should be easy....
The problem is, despite having something called GLUT.Framework loaded on the system, I don't seem to have a glut library to link to. I searched, and there is no libglut.a, or libglut.dylib that I can see. I did find GL, but I'm still getting undefined symbols _glutMainLoop, etc. Can anyone explain what I'm doing wrong?

Here's the makefile I put together:
INC=-I/usr/X11R6/include/GL -I/usr/X11R6/include -I/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/GLUT.framework/Versions/A/Headers/
LIB=-L/usr/X11R6/lib -lGL
lesson05: main.c
gcc -g $(INC) main.c $(LIB)

08-08-2007, 01:20 AM
Forget everything you know about X11.

gcc main.c -framework OpenGL -framework GLUT

and change
#include <GL/gl.h>
#include <GL/glut.h>
#include <OpenGL/gl.h>
#include <GLUT/glut.h>

08-08-2007, 08:58 AM
Thanks, that's just the ticket!

12-06-2007, 08:11 AM
Have you tried downloading the Cocoa sourcecode for any of the projects?
I'm interested in trying some of the Nehe OpenGL tutorials myself (with a view to possibly translating some of them into plugins for Quartz Composer). I have a lot to learn before I get to that stage, however.