Help needed badly!

Started by
11 comments, last by xpertgamer 22 years, 3 months ago
im getting very mad. my compiler keeps show me external linking error messages here it is : LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main this has popped up on two programs so far today.
Advertisement
That means the compiler can''t find a .lib file to compile your project.

For example : if you use DirectDraw you have to link your program to two files : Ddraw.lib and dxguid.lib

Try to find which are the needed files and link them...

How to link a file to your program ?? Well...if you use Visual Studio 6.0 : open your project, choose ''project'' in the menubar -> ''Settings'' -> In the ''Link'' tab, you write the needed .lib files in the ''Object/Library modules'' textbar.

But you should also tell the compiler where to find these .lib files on your computer (you have to do this only once)...choose ''Tools'' -> ''Options'' -> ''Directories'' -> Set the dropdown menu to library files -> Enter the directories.

Now it should work...
I have to ask this question.

Do you have a main() function in your program?

D.V.

Carpe Diem
D.V.Carpe Diem


Edited by - HolyFish on January 8, 2002 9:02:29 AM
your compiler is looking for main()... which means either you forgot to make one, or you are telling your compiler to generate a "win32 console application" (fake DOS window) but you really want a windows app...
if you are trying to create a windows program, you have to find that setting and change it. if you really want a console app, you need a main() function.

--- krez (krezisback@aol.com)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
Im using WinMain() so why is it still needing a _main?
If your compiler is set to win32 console app it will search for a main not a WinMain
humanity will always be slaved by its ignorance
it is a win32 app not a console app. does that make a difference?
i just did what the book said and even got the code off the cd and it still says the same thing!
if it is a windows application (non-console), you must use winmain(), and also set your compiler to copile a windows program (not a win32 console program).
there is a switch or option somewhere for you to change, if you really can''t find it tell us what compiler you use and someone will point it out for you.

--- krez (krezisback@aol.com)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
Ok im using visual C++ 6, and the only choices i have is a win32 app, or a win32 console app. i have borlnad to and i tried it on their and it gives me the same error. can someone try to compile my code on theirs and see if you can get it to work?

if you ask ill send you the code.

This topic is closed to new replies.

Advertisement