Advertisement

Damn VC compiler!

Started by February 13, 2003 12:18 PM
2 comments, last by Marty666 22 years ago
When compiling my project (MSVC++ 6.0) using the libraries opengl32.lib, glu32.lib and glut32.lib and the libs allready there. I included windows.h, GL\glut.h I get this error. LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 I started the program as a empty project for a win32 application. what is wrong? Thanx, _____ /____ /| | | | | MtY | | |_____|/ Marty
_____ /____ /|| | || MtY | ||_____|/Marty
It means you''ve created a win32 application instead of (I assume) the win32 console application you wanted. It''s looking for WinMain instead of main().

If you meant to create a win32 application, rather than a DOS app, then you haven''t got a WinMain function.
Advertisement
Great, now it works! thanx... One problem left. It opens 2 windows, my opengl window and a window titled

"c:\ ... \myproject.exe"

How to get rid of this one?

this is the code:

#ifdef __FLAT__
#include "windows.h"
#endif

//#include "gl\glu.h"
#include "gl\glut.h"

// This initializes the OpenGl window
void init()
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_FLAT);
}

// Clear and show the display
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glutSwapBuffers();
}

int main(int argc, char** argv)
{
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize (800, 600);
glutInitWindowPosition (100, 100);
glutCreateWindow ("GL!!!");
init();
glutDisplayFunc (display);
glutMainLoop();
return 0;
}
_____ /____ /|| | || MtY | ||_____|/Marty
The other window is the console window.. to disable it try this....

With Visual C++ 6.0, go to the Project menu, Settings… dialog. Select the Link tab. In the Project options edit box, add /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup to the end of the present text. Link options are similar for other Windows compilers



This topic is closed to new replies.

Advertisement