View Full Version : Running as a Win32 application

05-29-2003, 11:17 AM
I've coded OpenGl applications as Windows console applications, and they work fine. When I try to compile them as Win32 Applications, I got the following error:

LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug\test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe

So I found help on the forums saying to add the following line of code to the top of my program:
#pragma comment ( linker, "/entry:\"mainCRTStartup\"")

When I do this, I get the following error

error C2017: illegal escape sequence
Error executing cl.exe.

Anyone have any insight as to how to get OpenGL to run as a Win32 application? Thanks a bunch.

05-29-2003, 11:30 AM
basically, for a Win32 application, your program needs a WinMain (and ultimately a WndProc message handler) instead of main(). for a good barebones tutorial on setting up an OpenGL Win32 app, check out nehe (http://nehe.gamedev.net)