Okay, I don’t know if this is because I don’t have something installed or don’t have it installed correctly or something, but I’m getting a whole lot of errors. I just installed OpenGL to play with and tried to install glut. Maybe I did it wrong. I don’t know. Anyways where I’m getting the errors is when I try to compile an example program I found somewhere. It includes glut.h and finds it fine, but after that it brings up a list of like 30 undefined references. I’m pretty sure it’s because I either don’t have something or it’s in the wrong place. My compiler is bloodshed.net’s Dev-C++ 4. Here’s the example program.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glut.h>
GLenum doubleBuffer;
GLint thing1, thing2;
static void Init(void)
{glClearColor(0.0, 0.0, 0.0, 0.0); glClearAccum(0.0, 0.0, 0.0, 0.0); thing1 = glGenLists(1); glNewList(thing1, GL_COMPILE); glColor3f(1.0, 0.0, 0.0); glRectf(-1.0, -1.0, 1.0, 0.0); glEndList(); thing2 = glGenLists(1); glNewList(thing2, GL_COMPILE); glColor3f(0.0, 1.0, 0.0); glRectf(0.0, -1.0, 1.0, 1.0); glEndList();
}
static void Reshape(int width, int height)
{glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); glLoadIdentity();
}
static void Key(unsigned char key, int x, int y)
{switch (key) { case '1':
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glutPostRedisplay();
break;
case ‘2’:
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glutPostRedisplay();
break;
case 27:
exit(0);
}
}static void Draw(void)
{glPushMatrix(); glScalef(0.8, 0.8, 1.0); glClear(GL_COLOR_BUFFER_BIT); glCallList(thing1); glAccum(GL_LOAD, 0.5); glClear(GL_COLOR_BUFFER_BIT); glCallList(thing2); glAccum(GL_ACCUM, 0.5); glAccum(GL_RETURN, 1.0); glPopMatrix(); if (doubleBuffer) {
glutSwapBuffers();
} else {
glFlush();
}
}static void Args(int argc, char **argv)
{
GLint i;doubleBuffer = GL_FALSE; for (i = 1; i < argc; i++) {
if (strcmp(argv[i], “-sb”) == 0) {
doubleBuffer = GL_FALSE;
} else if (strcmp(argv[i], “-db”) == 0) {
doubleBuffer = GL_TRUE;
}
}
}int main(int argc, char **argv)
{
GLenum type;glutInit(&argc, argv); Args(argc, argv); type = GLUT_RGB | GLUT_ACCUM; type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE; glutInitDisplayMode(type); glutInitWindowSize(300, 300); glutCreateWindow("Accum Test"); Init(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutDisplayFunc(Draw); glutMainLoop();
}
and here’s the error’s I’m getting.
c:\windows\TEMP\ccHohbgb.o: In function
Init': //c/dev-c_~1/examples/opengl/accum.c:14: undefined reference to
imp__glClearColor’
//c/dev-c~1/examples/opengl/accum.c:15: undefined reference to_imp__glClearAccum' //c/dev-c_~1/examples/opengl/accum.c:17: undefined reference to
imp__glGenLists’
//c/dev-c~1/examples/opengl/accum.c:18: undefined reference to_imp__glNewList' //c/dev-c_~1/examples/opengl/accum.c:19: undefined reference to
imp__glColor3f’
//c/dev-c~1/examples/opengl/accum.c:20: undefined reference to_imp__glRectf' //c/dev-c_~1/examples/opengl/accum.c:21: undefined reference to
imp__glEndList’
//c/dev-c~1/examples/opengl/accum.c:23: undefined reference to_imp__glGenLists' //c/dev-c_~1/examples/opengl/accum.c:24: undefined reference to
imp__glNewList’
//c/dev-c~1/examples/opengl/accum.c:25: undefined reference to_imp__glColor3f' //c/dev-c_~1/examples/opengl/accum.c:26: undefined reference to
imp__glRectf’
//c/dev-c~1/examples/opengl/accum.c:27: undefined reference to_imp__glEndList' c:\windows\TEMP\ccHohbgb.o: In function
main’:
//c/dev-c_~1/examples/opengl/accum.c:103: undefined reference toglutInit' //c/dev-c_~1/examples/opengl/accum.c:108: undefined reference to
glutInitDisplayMode’
//c/dev-c_~1/examples/opengl/accum.c:109: undefined reference toglutInitWindowSize' //c/dev-c_~1/examples/opengl/accum.c:110: undefined reference to
glutCreateWindow’
//c/dev-c_~1/examples/opengl/accum.c:114: undefined reference toglutReshapeFunc' //c/dev-c_~1/examples/opengl/accum.c:115: undefined reference to
glutKeyboardFunc’
//c/dev-c_~1/examples/opengl/accum.c:116: undefined reference toglutDisplayFunc' //c/dev-c_~1/examples/opengl/accum.c:117: undefined reference to
glutMainLoop’
c:\windows\TEMP\ccHohbgb.o: In functionReshape': //c/dev-c_~1/examples/opengl/accum.c:33: undefined reference to
imp__glViewport’
//c/dev-c~1/examples/opengl/accum.c:35: undefined reference to_imp__glMatrixMode' //c/dev-c_~1/examples/opengl/accum.c:36: undefined reference to
imp__glLoadIdentity’
//c/dev-c~1/examples/opengl/accum.c:37: undefined reference to_imp__glMatrixMode' //c/dev-c_~1/examples/opengl/accum.c:38: undefined reference to
imp__glLoadIdentity’
c:\windows\TEMP\ccHohbgb.o: In functionKey': //c/dev-c_~1/examples/opengl/accum.c:50: undefined reference to
imp__glPolygonMode’
//c/dev-c~1/examples/opengl/accum.c:51: undefined reference toglutPostRedisplay' c:\windows\TEMP\ccHohbgb.o: In function
Draw’:
//c/dev-c~1/examples/opengl/accum.c:61: undefined reference to_imp__glPushMatrix' //c/dev-c_~1/examples/opengl/accum.c:63: undefined reference to
imp__glScalef’
//c/dev-c~1/examples/opengl/accum.c:65: undefined reference to_imp__glClear' //c/dev-c_~1/examples/opengl/accum.c:66: undefined reference to
imp__glCallList’
//c/dev-c~1/examples/opengl/accum.c:67: undefined reference to_imp__glAccum' //c/dev-c_~1/examples/opengl/accum.c:69: undefined reference to
imp__glClear’
//c/dev-c~1/examples/opengl/accum.c:70: undefined reference to_imp__glCallList' //c/dev-c_~1/examples/opengl/accum.c:71: undefined reference to
imp__glAccum’
//c/dev-c~1/examples/opengl/accum.c:73: undefined reference to_imp__glAccum' //c/dev-c_~1/examples/opengl/accum.c:75: undefined reference to
imp__glPopMatrix’
//c/dev-c~1/examples/opengl/accum.c:78: undefined reference toglutSwapBuffers' //c/dev-c_~1/examples/opengl/accum.c:80: undefined reference to
_imp__glFlush’
Please tell me you can tell me what’s going on here. Thanx.