GLUT & OpenGL problems

D

dcholth

Guest
I am new to XCode and programming on a mac, so this may be a very simple problem...
I'm trying to program some very basic OpenGL programs for my graphics class. I'm using the book 'Interactive Computer Graphics' by Edward Angel if anyone is familiar with it.
I copied a program from the tutorials section that makes a simple cube that can be rotated w/ the mouse. Making a few minor changes (fixes really), I got it to compile. I made these same changes on the linux machine in the lab and it worked perfectly.
On my mac however I am getting missing variables. Everytime I try to run it says:
ZeroLink: unkown symbol '_glutInit'
Proj1 has exited due to signal 6 (SIGABRT)

I originally thought this was a memory problem, but upon closer inspection I see it has to do with the glut initialization. The error happens during the first few lines of the main function:

int
main(int argc, char *argv[]){
glutInit(&argc, argv); //Highlighted line in debugger

I've compared my init and intro to main method with that of some of the example GLUT files in Xcode (bluepony.c) and it is the same. Can anyone help me?

Interestingly enough all the example OpenGL GLUT programs installed with XCode work. My professor beleives they have something in their compilation that is different than what I am doing... I cant for the life of me figure out how to look at those perameters though.

Thanks
Dan

ps> if you need mor einformation, reply, and i'll post code snippets and stuff.
 
OP
B

Bo Eddy

Guest
well post what fixed it maybe you can help someone else..

so what was the solution?
 
OP
D

dr_springfield

Guest
Those type errors are generated when u forget to add the framework, so most likely the solution was adding the GLUT framework.
 
OP
P

pita

Guest
Just add the GLUT.framework to the project

*************
PITA REPLIES:
Just add the GLUT.framework to your project using
Project->Add Frameworks in Mac OS X.

Then ensure that the header include line is:
#include <GLUT/glut.h> /* not <GL/whatever.h> */


that's all you'll need to do.

*************


dcholth said:
I am new to XCode and programming on a mac, so this may be a very simple problem...
I'm trying to program some very basic OpenGL programs for my graphics class. I'm using the book 'Interactive Computer Graphics' by Edward Angel if anyone is familiar with it.
I copied a program from the tutorials section that makes a simple cube that can be rotated w/ the mouse. Making a few minor changes (fixes really), I got it to compile. I made these same changes on the linux machine in the lab and it worked perfectly.
On my mac however I am getting missing variables. Everytime I try to run it says:
ZeroLink: unkown symbol '_glutInit'
Proj1 has exited due to signal 6 (SIGABRT)

I originally thought this was a memory problem, but upon closer inspection I see it has to do with the glut initialization. The error happens during the first few lines of the main function:

int
main(int argc, char *argv[]){
glutInit(&argc, argv); //Highlighted line in debugger

I've compared my init and intro to main method with that of some of the example GLUT files in Xcode (bluepony.c) and it is the same. Can anyone help me?

Interestingly enough all the example OpenGL GLUT programs installed with XCode work. My professor beleives they have something in their compilation that is different than what I am doing... I cant for the life of me figure out how to look at those perameters though.

Thanks
Dan

ps> if you need mor einformation, reply, and i'll post code snippets and stuff.
***************************************
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top