I cannot compile in MAC OS10.3.7 for a mysterious reason

Hi there,
I am trying to compile a simple code to learn how to use some mouse functions. but the compiler returns me the following message:

d: Undefined symbols:
_glutCreateWindow
_glutDisplayFunc
_glutInit
_glutInitDisplayMode
_glutInitWindowSize
_glutMainLoop
_glutMotionFunc
_glutMouseFunc

Why is this happening? Is there anything missing in my header?

Thanks

Tom

this is the header i am using:

#include <iostream>
#include <OpenGL/gl.h>
#include <GLUT/glut.h>

#define myON 1;
#define myOFF 0;

struct point2d{
float x;
float y;
};

point2d mouse_click;
point2d mouse_pos;
point2d mouse_mov;
int mouseleft =0;
float dist =0;

int main(int argc, char** argv) ;
void drawCircle(void) ;
/void keyboardFunc(unsigned char key, int x, int y);/
void mouseFunc(int button, int state, int x, int y);
void mouseMotion(int x, int y);
void instructions(void);
void circle(point2d mouse_pos, float dist);

:smiley:

You probably need to link the glut libs (glut32.lib) in to your program

Thank you,

How do i do that?

Tom

:smiley:

Thank you,

How do i do that?

Tom

:smiley:

You need to link against GLUT. Use -framework GLUT -lobjc if you’re compiling from the command line, or add GLUT to the project if you’re using Xcode.

Keith has a tutorial for this.

Thanks

it works.