PDA

View Full Version : Damn error!



Digity
09-24-2002, 04:34 PM
I keep getting the following error using MS Visual C++ 6.0.

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

Example.exe - 2 error(s), 0 warning(s)

Here's my program:

#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.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 () {
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POINTS);
glVertex2i(100, 50);
glVertex2i(100, 130);
glVertex2i(150, 130);
glEnd();
glFlush();
}

int 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();

return 0;
}

I keep getting this error...so I dont' think it has anything to do with the program. If someone could explain to me what the error means and what I can do about it I'd greatly appreciate it.

t0y
09-24-2002, 04:53 PM
This is a very common error:

Searching the forums for "winmain":
http://www.opengl.org/discussion_boards/ubb/Forum2/HTML/009826.html

good luck!

Digity
09-24-2002, 04:56 PM
Yeah, I figured it out pretty quickly. I didn't know I was suppose to have a Console Application, but anyway, it works now. Thanks anyways.