Cannot configure OpenGL / GLUT
Hi, I'm trying to get a simple program to run on my iBookG4, i've configured the makefile and .cpp file (included below) but it keeps coming up with the following error message when i type 'make hello':
/usr/bin/ld: Undefined symbols:
_glClear
_glClearColor
_glColor3f
_glFlush
_glutCreateWindow
_glutMainLoop
collect2: ld returned 1 exit status
make: * [hello] Error 1
I got a friend of mine with a mac to run it on theirs and it works fine, but for some reason it just wont compile on mine, i have both OpenGL and GLUT frameworks installed (as came with the computer).
I don't know what else to try, any help would be great.
--------MAKEFILE-------
CC = g++ -g -Wall -ansi
all:
${CC} *.cpp -framework OpenGL -framework GLUT -o output.exe
clean:
rm *.exe
--------HELLO.CPP---------- Just so you know what it is trying to access:
#include <stdio.h>
#include <OpenGL/gl.h>
#include <GLUT/glut.h>
void display(void)
{
glClear(GL COLOR_BUFFERBIT);
glFlush();
}
void init()
{
/* set clear color to black */
glClearColor (0.1, 0.0, 0.5, 0.0);
/* set fill color to white */
glColor3f(1.0, 0.0, 0.0);
/* set up standard orthogonal view with clipping */
/* box as cube of side 2 centered at origin */
/* This is default view and these statement could be removed */
/* glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); */
}
int main(int argc, char** argv)
{
/* Initialize mode and open a window in upper left corner of screen */
/* Window title is name of program (arg[0]) */
/* glutInit(&argc,argv); */
// glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); /
// glutInitWindowSize(600,600);
// glutInitWindowPosition(300,200);
glutCreateWindow("Function = sinc(x)");
// glutDisplayFunc(display);
// init();
glutMainLoop();
}
----------
Thanks,
Dan
/usr/bin/ld: Undefined symbols:
_glClear
_glClearColor
_glColor3f
_glFlush
_glutCreateWindow
_glutMainLoop
collect2: ld returned 1 exit status
make: * [hello] Error 1
I got a friend of mine with a mac to run it on theirs and it works fine, but for some reason it just wont compile on mine, i have both OpenGL and GLUT frameworks installed (as came with the computer).
I don't know what else to try, any help would be great.
--------MAKEFILE-------
CC = g++ -g -Wall -ansi
all:
${CC} *.cpp -framework OpenGL -framework GLUT -o output.exe
clean:
rm *.exe
--------HELLO.CPP---------- Just so you know what it is trying to access:
#include <stdio.h>
#include <OpenGL/gl.h>
#include <GLUT/glut.h>
void display(void)
{
glClear(GL COLOR_BUFFERBIT);
glFlush();
}
void init()
{
/* set clear color to black */
glClearColor (0.1, 0.0, 0.5, 0.0);
/* set fill color to white */
glColor3f(1.0, 0.0, 0.0);
/* set up standard orthogonal view with clipping */
/* box as cube of side 2 centered at origin */
/* This is default view and these statement could be removed */
/* glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); */
}
int main(int argc, char** argv)
{
/* Initialize mode and open a window in upper left corner of screen */
/* Window title is name of program (arg[0]) */
/* glutInit(&argc,argv); */
// glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); /
// glutInitWindowSize(600,600);
// glutInitWindowPosition(300,200);
glutCreateWindow("Function = sinc(x)");
// glutDisplayFunc(display);
// init();
glutMainLoop();
}
----------
Thanks,
Dan
iBook G4, Mac OS X (10.4.4)