PDA

View Full Version : Unresolved external symbol _main?



denis
11-23-2000, 02: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...

Linking...
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...
Denis.

Deiussum
11-23-2000, 03: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

denis
11-23-2000, 05: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