Help needed badly!
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.
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...
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...
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)
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)
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!
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)
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)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement