View Full Version : program linking trouble in VC++

01-26-2004, 06:54 PM
Ive been programming in OpenGL for a few weeks now and the most common problem I get is this weird link error. Sometimes it shows up sometimes not. I usually just start adding libraries until it goes away but Id really like to know what the hell is going on? Has anyone seen this error or know what it is?

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

01-26-2004, 07:01 PM
you have created a win32 app, which expects the entry point WinMain
you have provided code for a win32 console app, which uses the entry point main(). Just create a new project as a console application and your code should work fine

01-26-2004, 09:32 PM
127 hits in the archive

01-28-2004, 12:26 AM
you can open up GL in either the win32 api interface or console based depending on your code.also make sure you are linking the libary files for application. opengl32.lib glu32.lib glaux.lib must be part of your linker tables...

01-29-2004, 05:16 AM
So, if you build a counsel app, it's main(), but if you build a win32 app it's got to be winmain()? I thought that was only if your specifically using the win32 api? Doesn't glut (oh, I'm using glut btw) provide some kind of translation for this?

01-29-2004, 07:21 AM
The entry point is determined by the parameters you pass to the linker. By default, a Win32 Console app tells the linker that there is going to be an entry point named "main()", and a Win32 Application tells the linker there is going to be an entry point named "WinMain()." So, either start the project with the correct wizard, or look into the linker settings after you start the project.

01-30-2004, 03:05 PM
Ahhh! That was it. Thanks so much. I just changed the entry point in the linker settings.