Getting linker error

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Draco
Posts: 14
Joined: Sat Mar 13, 2004 8:55 pm

Getting linker error

Post 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?
Draco
Posts: 14
Joined: Sat Mar 13, 2004 8:55 pm

Post 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
thesmileman
Posts: 360
Joined: Tue Feb 10, 2004 2:20 am
Location: Lubbock, TX

Post 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()?
Draco
Posts: 14
Joined: Sat Mar 13, 2004 8:55 pm

Post 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.
Narcotic

Post by Narcotic »

This is exactly the problem I'm having. I chose a win32 application, and then just added a new class called main.
thesmileman
Posts: 360
Joined: Tue Feb 10, 2004 2:20 am
Location: Lubbock, TX

Post 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).
Draco
Posts: 14
Joined: Sat Mar 13, 2004 8:55 pm

Post 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.
Post Reply