I get these errors: LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe. When I try and execute this program. I've looked in my code, and experimented, but nothing works. Is it in my code? I tried recompiling the entire thing from scratch. That didn't work either. I'm going to be on aim for a while so im me please if you think you can help.
Code:
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")
#pragma comment(lib, "glaux.lib")
#pragma comment(lib, "glut32.lib")
#pragma comment(linker, "/subsystem:windows")
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glaux.h>
#include <GL/glut.h>
#include <stdio.h>
void draw()
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glFlush();
}
void reshape(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -1.0, 1.0, 0.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void init(void)
{
glEnable(GL_DEPTH_TEST);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glShadeModel(GL_SMOOTH);
}
void main(void)
{
glutInitDisplayMode(GL_DOUBLE | GL_RGB);
glutCreateWindow("Opengl");
glutDisplayFunc(draw);
glutReshapeFunc(reshape);
init();
glutMainLoop();
}