Advertisement

link errors in visual c++ 6.0 in anything i program

Started by November 19, 2002 01:05 PM
12 comments, last by com 21 years, 11 months ago
I keep getting link errors in anything i program, even a simple hello world program so i figure it must be my compiler. Can anyone help? LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/1.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe.
Make sure you are programming a hello world program as a console application.
Advertisement
My guess is that you probably forgot to include the necessary library files (.lib) in your project file.

What compiler are you using?

Missing or out of date include files may also be the culprit.

Hope that helps. Try being a little more specific and I can probably help you get your code to build.

-Q

"Things could get ugly."
- The Genie (Return of Jafar) (don''t ask me why I thought of this)
project->settings->link tab->project options control:

make sure the /subsystem setting is console, not windows.
ah thx guys, my bad ive been so ust to windows programming that i forgot for a console appliaction u need to use a console application
great the error is back again and im programming in a console application.
libcd.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Accounting Application.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Advertisement
You don''t use WinMain() for a console app. Just main().

Also, like I said earlier, make sure you have included all the necessary .lib files in your project, and also make sure that you have all the updated .dlls. I have gotten this same error before and it was because I either didn''t have:
a.) The correct .h file in my compiler include directory (or project directory)
b.) The necessary .lib files included with my project
c.) The necessary .dll files installed on my system

Hope that helps you track down your problem.

-Q
I assume you''re using MS Visual C++. Delete all the project/workspace files (keep all your .h and .cpp files obviously). Create a new project, and when it asks you what type make sure you pick ''Win32 Console Application'' not ''Win32 Application.'' Add all your old .h and .cpp files to the project and build the exe.
i did only use main() , and i have checked over and over to see if i have all the lib and include files although im not so sure about the dlls. ill have a little try with Dobbs idea.
ah works after i removed the project files and put the source into the new project. thx

This topic is closed to new replies.

Advertisement