Page 1 of 1

Getting linker error

Posted: Wed Mar 17, 2004 3:25 am
by Draco
I read the tutorial on how to do split screen and pasted it into a cpp file to see it in action. It compiles fine but gets a linker error.

Code: Select all

LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
All the other programs I've tried to do have worked fine, however they have been in the main irrlicht folder and this one is in the my_projects folder, is that the problem? If not, can anyone tell me what is?

Posted: Wed Mar 17, 2004 4:57 am
by Draco
as an update: I figured out that it is the folder location that did it. Now my question is, why does it matter?

update again: Now I can't get it to compile anywhere

Posted: Thu Mar 18, 2004 4:15 am
by thesmileman
I am not sure but I would think you set you project up incorrectly as the linker error is about missing WinMain@16 not an irrlicht file. Did you by any chance choose to create a console application and then are using WinMain()instead of main()?

Posted: Thu Mar 18, 2004 7:12 am
by Draco
no, I chose a windows application and am using main, but it is something with the project because when I open the cpp file I'm working on and build it with the general workspace and no project it works.

Posted: Thu Mar 18, 2004 7:48 pm
by Narcotic
This is exactly the problem I'm having. I chose a win32 application, and then just added a new class called main.

Posted: Thu Mar 18, 2004 9:30 pm
by thesmileman
You might try two things. Since you chose a win32 application you should use WinMain() instead of main():

Code: Select all

#include <windows.h> 
#include <windowsx.h> 
. 
. 
. 
int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, INT ncmdshow)

If you choose a console application and use main() you will have a console window in the background (Which is quite helpful for getting informaiton from irrlicht).

Posted: Thu Mar 18, 2004 10:42 pm
by Draco
thanks a lot. I figured it couldnt be a console project. You also answered my question of how to get rid of the console window when I got an application good enough that I wouldnt need to look at the output anymore.