[SOLVED] LIBCD.lib(crt0.obj) : error LNK2001: ...

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
ijo coim
Posts: 57
Joined: Fri Mar 25, 2005 1:29 pm
Location: indonesia, jogja-jogja

[SOLVED] LIBCD.lib(crt0.obj) : error LNK2001: ...

Post by ijo coim »

Haloo forum. :lol:

i made 3 files :
kata2.cpp //the file that i want to show
kata2.h //header file for kata2.cpp
main_kata_2.cpp //the file that i execute

in main_kata_2.cpp, i write code like this (i got it from demo (in MAIN.CPP))

Code: Select all

#pragma comment (lib, "Irrlicht.lib")

#ifdef _WIN32
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
#else
int main()
#endif
{
.
.
.
}
when i compile it, it's ok. but when i execute it, it gives me error like this:

Code: Select all

Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/main_kata_2.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

main_kata_2.exe - 2 error(s), 0 warning(s)
then, i disable this code:

Code: Select all

#pragma comment (lib, "Irrlicht.lib")

[b]//#ifdef _WIN32
//INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )[/b]
[b]//#else[/b]
int main()
[b]//#endif[/b]
{
.
.
.
}
it can work.
so, when you got the same error like that :shock: , try to disable those code :wink: , maybe it can help.

btw, why does it can be happen? :?:
hybrid

Post by hybrid »

Sorry, but your suggestion is just a bad hack, not a solution. Check your compiler manual for how to change your projects from console app to windows app (or search the forum, there had been many threads on this). You're supposed to use WinMain or main depending on the type of app you're creating.
ijo coim
Posts: 57
Joined: Fri Mar 25, 2005 1:29 pm
Location: indonesia, jogja-jogja

sorry

Post by ijo coim »

Code: Select all

Sorry, but your suggestion is just a bad hack, not a solution.
ooppppsss,sorry if gave a bad solution. i'll try to find how can it be. but, it really-really work for me.

thanks for the fast reply.
Post Reply