View Full Version : unresolved external symbol _main???
09-10-2003, 04:47 PM
I'm using Microsoft Visual C++ 6.0, and I'm trying to compile the mouse.c tutorial I downloaded from opengl.org. I get the following error message:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
I just included opengl32.lib, glu32.lib and glaux.lib in my Projects/Settings/Link. Was that a bad thing?
09-10-2003, 06:30 PM
Visual C, like other compilers, can create two types of Win32 applications: GUI apps and console apps. The latter starts up in a DOS box-like console and requires a main function, while a GUI app requires a WinMain function.
You get to choose when you start a new project. Chances are, you have set up a console project and the code in question was meant for a GUI project.
You can either sratch the current project and start a new one, or change your linker options. There should be the option "/subsystem:console" in the linker settings tab. Find that and change it to "/subsystem:windows".
09-11-2003, 05:35 AM
It's looking for a main, which means the project should have been started as a Console app.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.