OpenGL实验程序,Link错误,请教原因。
这是学OpenGL的第一个程序:hello world,再vc6下编译通过,link出错,信息是:
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Hello.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
请教原因。
程序清单:
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glaux.h>
void CALLBACK draw(void);
void CALLBACK reshape(int width,int height);
void CALLBACK reshape(int width,int height){
//Set the new viewport size
glViewport(0,0,(GLint)width,(GLint)height);
//Clear the window
glClear(GL_COLOR_BUFFER_BIT);
}
void CALLBACK draw(void){
//Set the drawing color
glColor3f(1.0,1.0,1.0);
glBegin(GL_POLYGON);
glVertex2f(-0.5,-0.5);
glVertex2f(-0.5,0.5);
glVertex2f(0.5,0.5);
glVertex2f(0.5,-0.5);
glEnd();
glFlush();
}
void main(int argc,char** argv){
auxInitDisplayMode(AUX_SINGLE|AUX_RGBA);
auxInitPosition(0,0,400,400);
auxInitWindow("Hello,World!");
auxReshapeFunc(reshape);
auxMainLoop(draw);
}