Advertisement

Problem with GLUT

Started by February 16, 2003 03:04 PM
0 comments, last by Tigra7 21 years, 9 months ago
I have been programming in opengl without glut for a while now. I just looked over it and downloaded it and then set it up. I wanted to see if it worked so I wrote a simple program:

#include <windows.h>             
#include <gl\gl.h>                 
#include <gl\glu.h>                
#include <gl\glut.h>           

int main(int argc, char **argv);

int main(int argc, char **argv)
{
  glutInit(&argc,argv);     
  
  glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);  

  glutCreateWindow("Chris'' Glut Program");                    
  
  glMatrixMode(GL_PROJECTION);   

  gluPerspective(45,     //view angle
                 1.0,    //aspect ratio
                 10.0,   //near clip
                 200.0); //far clip

  glMatrixMode(GL_MODELVIEW);   

  glutMainLoop();              

  return 0;
}
 
The message it comes up with is, "
 LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/GameEngine.exe : fatal error LNK1120: 1 unresolved externals  
Any help?
You setup your MSVC project incorrectly. Try it again, this time as a Win32 console application. Also, remove your first three lines in that file (the including of windows.h, GL/gl.h, and GL/glu.h; GL/glut.h handles the last two, and you shouldn''t have even done the first).

This topic is closed to new replies.

Advertisement