Problem of Using glut with VC++

Dear All,
I’ve a problem using glut function with VC++.
I’ve copied the glu32.dll and glut32.dll into the system directory, also, I’m also setup the lib and header directory for the VC++ linker to find the glut32.lib, glu32.lib, gl.h, glu.h and glut.h.
But when I complie the following code, the error message appears like this:

LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/testing4.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

And here is my code:

#include<windows.h>
#include<gl/GL.h>
#include<gl/glut.h>

void myInit(void)
{
glClearColor(1.0,1.0,1.0,0.0);
glColor3f(0.0f, 0.0f, 0.0f);
glPointSize(4.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, 640.0, 0.0, 480.0);
}

void myDisplay(void)
{
glClear(GL_GOLOR_BUFFER_BIT);
glBegin(GL_POINTS);
glVertex2i(100, 50);
glVertex2i(100, 130);
glVertex2i(150, 130);
glEnd();
glFlush();
}

void main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(640, 480);
glutInitWindowPosition(100, 150);
glutCreateWindow(“my first attempt”);
glutDisplayFunc(myDisplay);
myInit();
glutMainLoop();
}

pleae help

You have created a Win32 Application, thats the problem. When creating a Win32 Applicaiton the entry point will be WinMain(). You need to create a Win32 Consol Application, which has it’s entry point in main().

So, create a new project, a Win32 Consol Application, add the file again and compile. There are some ways go get past the procedure of creating a new project, but then you have to mess with linker options, and I won’t explain that.

yes, it work now. thank you