I’m reading the OpenGL super bible 4th edition. I’ve installed glut, glew, glee. I am using Microsoft visual C++ 2008. when I complie the following code I get the following errors:
#include "opengl.h" // Custom open GL header
// Called to draw a scene
void RenderScene(void)
{
// Clear the window with current clearing color
glClear(GL_COLOR_BUFFER_BIT);
// Flush drawing commands
glFlush();
}
// Setup the rendering state
void SetupRC(void)
{
glClearColor(0.0f, 0.0F, 1.0f, 1.0f);
}
// Main program entry point
void main(void)
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
glutCreateWindow("Simple");
glutDisplayFunc(RenderScene);
SetupRC();
glutMainLoop();
return 0;
}
With that code I get these following errors…
error C2144: syntax error : ‘int’ should be preceded by ‘;’
error C2731: ‘main’ : function cannot be overloaded
see declaration of ‘main’
Here is the header file just incase:
// Windows
#ifdef WIN32
#include <windows.h>
#include <glee.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <glut.h>
#endif
// Mac Os X
#ifdef _APPLE_
#include <Carbon/Carbon.h>
#include "glee.h"
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <Glut/glut.h>
#endif