Original Post
hi, im trying to do some ogl stuff, im reading the Redbook, chapter 1 and i got to this glut example, i did exactly as it''s said in the book but i get errors.can anyone help me?
#include <windows.h>
#include <gl/gl.h>
#include <gl/glut.h>
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_POLYGON);
glVertex3f(0.25, 0.25, 0.0);
glVertex3f(0.75, 0.25, 0.0);
glVertex3f(0.75, 0.75, 0.0);
glVertex3f(0.25, 0.75, 0.0);
glEnd();
glFlush();
}
void init(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(230, 230);
glutInitWindowPosition(100, 100);
glutCreateWindow("test2");
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
--------------------Configuration: test2 - Win32 Debug--------------------
Compiling...
test2.cpp
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/test2.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
test2.exe - 2 error(s), 0 warning(s)