Trying to build app using glut

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)

Forget everything you know about X11.

gcc main.c -framework OpenGL -framework GLUT

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

Thanks, that’s just the ticket!

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.

alx

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.