Archived

This topic is now archived and is closed to further replies.

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

This topic is 5504 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
project->settings->link tab->project options control:

make sure the /subsystem setting is console, not windows.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
I had that error a while back in a pure Win32 project, and found it had nothing to do with project settings. There's one include that you are not allowed to miss out because it defines a few necessary macros that convert names: tchar.h . (yes, I know, what the **bleep** does tchar have to do with winmain? Well, the easy answer is "the necessary definitions for being to handle multibyte character sets if you want them supported in your project").

Now, my project was not a console project, but try including tchar.h before your main, and see if that helps.


Edit: whoops, well that wasn't it, then heheh. I'll leave the rest of the message here though, in case someone else has a similar problem.


[edited by - the_Programmer_Goblin on November 22, 2002 3:46:38 AM]

Share this post


Link to post
Share on other sites
One last question: my program outputs a question then the user has to answer and it does this for about 10 questions the only problem is it outputs the first question the user answers then it outputs the secound and the user answers then it decides to output every question and then says press any key to exit and i dont want this to happen. Im sure there is a simple way to stop it like ages ago i knew a way to pause the system i belive it was #include <conio.h> then use system.pause(); but im not so sure. anyone know?

Share this post


Link to post
Share on other sites
It''ll give you the pause message if you''re running it from MSVC++ IDE. Run it directly from the disk, and it won''t do this.


Don''t listen to me. I''ve had too much coffee.

Share this post


Link to post
Share on other sites