Newbie Can't Compile

Hi, I am trying my hand at OpenGL on OS X
10.1 and cannot get a compile to work. I’ve
had limited experience on Linux with OpenGL but have decided to focus my efforts on OS X.

Here is my compile line:
cc -framework OpenGL -framework GLUT -lobjc test.c

and here is the result which I cannot figure
out how to eliminate:

/usr/bin/ld: Undefined symbols:
_glutInitMac

I have looked at the SDK download from
Apple and in the framework folders but
am unable to figure anything out from
that.

Any help would be appreciated very much!
Mak

I had no problem compiling the hello.c program from the “lego” OpenGL book with your compile line. I did this under both OS 10.1.1 and 10.1.2.

Perhaps if you posted your program, more insight as to the problem might be gained.

Vik

Looks like you are using the headers from the OpenGL 1.2.1 SDK. Those headers are for MacOS <= 9, not MacOSX. All the headers and libraries you need are included with MacOSX and/or the developer tools.

You may need to change your includes to <GLUT/glut.h> and <OpenGL/gl.h> to fix the problem.

OneSadCookie: Thank you very much for
your response. That was exactly it, wrong included header directory. Thanks again for all the responses from everyone!

mak

Originally posted by OneSadCookie:
[b]Looks like you are using the headers from the OpenGL 1.2.1 SDK. Those headers are for MacOS <= 9, not MacOSX. All the headers and libraries you need are included with MacOSX and/or the developer tools.

You may need to change your includes to <GLUT/glut.h> and <OpenGL/gl.h> to fix the problem.[/b]

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