PDA

View Full Version : I cannot compile in MAC OS10.3.7 for a mysterious reason



tomaya
02-27-2005, 01:49 PM
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);

:D

UrbanLegend
02-27-2005, 01:59 PM
You probably need to link the glut libs (glut32.lib) in to your program

tomaya
02-27-2005, 02:07 PM
Thank you,

How do i do that?

Tom

:D

tomaya
02-27-2005, 02:08 PM
Thank you,

How do i do that?

Tom

:D

arekkusu
02-27-2005, 04:21 PM
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 (http://onesadcookie.is-a-geek.net/~keith/XcodeGLUT/) for this.

tomaya
02-27-2005, 04:27 PM
Thanks

it works.