L3M0L
L3M0L

Reputation: 429

OpenGL and VS2010 unresolved external

I want to use GLUT to simplify my code and work.

I'm using windows 7 (64 bit) and Visual Studio 2010. I did everything like in this tutorial and still can't compile my code... I get these errors:

Error 2 error LNK1120: 1 unresolved externals <path>
Error   1   error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartuL  

The code I use:

#include <GL/glew.h> 
#include <GL/glut.h> 

void display (void) {  
   glClearColor(1.0f, 0.0f, 0.0f, 1.0f);  
   glClear(GL_COLOR_BUFFER_BIT); 
   glLoadIdentity(); 

   glFlush(); 
}  

int main (int argc, char **argv) {  
   glutInit(&argc, argv); 
   glutInitDisplayMode (GLUT_SINGLE); 
   glutInitWindowSize (500, 500); 
   glutInitWindowPosition (100, 100); 
   glutCreateWindow ("Your first OpenGL Window");  

   glutDisplayFunc(display); /

   glutMainLoop(); 
} 

Does someone know whats the problem and how to fix it?

Upvotes: 1

Views: 188

Answers (1)

Shmil The Cat
Shmil The Cat

Reputation: 4668

Seems that your created Windows application instead of a Console one. See the pic below for how to change/choose the Windows subsystem

enter image description here

Upvotes: 1

Related Questions