PDA

View Full Version : link error-please help......



10-24-2004, 11:30 AM
i get this link error
inking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/ktm rockets.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

but if i change the source file and compile let's say
a .cpp file by NeHe the problem doesn't happen under the same project
the code with the problem is from the red book the first example!
i have linked all the libraries from project/settings correctly
i have tried placing glut.dll into the same directory with the project but nothing
please help...
it doesn't make sense since i've managed to compile
this file someday but now sth goes wrong.i'm using windows xp

MikeC
10-24-2004, 12:50 PM
When using GLUT, you should generally create "Console" projects rather than Win32 projects. The console/win32 choice determines what entrypoint function Windows will look for when running your app. For a console project it'll look for "main" (which GLUT provides) whereas for a Win32 project it'll look for "WinMain" (which neither GLUT nor you are currently providing).

Either recreate your project as a console app, or change the "subsystem:" option in the linker settings. (You'll need to check your compiler/IDE documentation for this.)

10-24-2004, 11:07 PM
my friend you are great!i couldn't figure out the solution for months so i had given up the coding.
thanks a lot!