PDA

View Full Version : program linking trouble in VC++



galenb
01-26-2004, 07:54 PM
Hey,
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?




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

chowe6685
01-26-2004, 08: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

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

ian2k6
01-28-2004, 01: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...

galenb
01-29-2004, 06: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?

Deiussum
01-29-2004, 08: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.

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

-=GB=-