Wednesday, 21 August 2013

OpenGL running in Visual C++ 2010 Express - identifier not found

OpenGL running in Visual C++ 2010 Express - identifier not found

I´m trying to compile the code below for the start of a OpenGL class and
the build fails. What can I do to correct this? Is it something to do with
the linker?
#include <windows.h>
#include <gl/GL.h>
#include <gl/GLU.h>
//Drawing funciton
void draw(void)
{
//Background color
glClearColor(1,0,0,1);
glClear(GL_COLOR_BUFFER_BIT );
//Draw order
glutPostRedisplay();
glFlush();
}
//Main program
int main(int argc, char **argv)
{
glutInit(&argc, argv);
//Simple buffer
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA );
glutInitWindowPosition(100,100);
glutInitWindowSize(800,400);
glutCreateWindow("Red window");
//Call to the drawing function
glutDisplayFunc(draw);
glutMainLoop();
return 0;
}
Thx in advance :-)
Thomas

No comments:

Post a Comment