Hi!
I was trying to run a code example from the book i’m trying to learn openGL from, and it won’t work (VERY disappointed ) I’m using VC++ 6.0.
Please help me, i really want to learn!
CODE (from openGL programming guide third edition):
#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.25, 0.25, 0.0);
glVertex3f(0.25, 0.25, 0.0);
glVertex3f(0.25, 0.25, 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(250, 250);
glutInitWindowPosition(100, 100);
glutCreateWindow(“hello”);
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
ERROR:
--------------------Configuration: temp - Win32 Debug--------------------
Linking…
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/temp.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
temp.exe - 2 error(s), 0 warning(s)