View Full Version : Unresolved external symbol _main?

11-23-2000, 01:51 PM
While trying to compile my first open gl application I got the following error and was wondering how I could fix it up...

LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Cpp2.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

If anyone can help me...

11-23-2000, 02:17 PM
That seems to be a common problem. People either try to use Glut in a main() function in a project that tries to look for WinMain as the entry point, or they create a project that uses main() as the entry point and try to create the OGL Window using Win32 code in a WinMain. http://www.opengl.org/discussion_boards/ubb/smile.gif

If you are using VC++, you need to start your project as a Win32 Application if you want to use a WinMain()... if you want to use a main() (usually for use with Glut) you need to start your project as a Win32 Console Application. If you want to use MFC, well then start it as an MFC app. http://www.opengl.org/discussion_boards/ubb/smile.gif

11-23-2000, 04:33 PM
Thanks a lot http://www.opengl.org/discussion_boards/ubb/wink.gif

We all got to start off somewhere http://www.opengl.org/discussion_boards/ubb/smile.gif