• Advertisement
Sign in to follow this  

problem with linking in Visual Studio 2005

This topic is 3391 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

Hi, I have a problem with linker errors. Here is what i get when i compile: Error 7 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup MSVCRTD.lib Error 8 fatal error LNK1120: 1 unresolved externals Can you please help me, Thanks in advanced, Penka

Share this post


Link to post
Share on other sites
Advertisement
Your linker is trying to tell you that a symbol, a function called WinMain in this case, is not defined anywhere in your code. In other words, you probably have created a Win32 application project, when you should have created console application project.

Win32 project's entrypoint is WinMain, where as in the console application the entrypoint is main. As you don't have WinMain defined, linking fails. I assume you don't have a very large codebase, so just create a new project as a console project and copy your current source code into it. That should work.

Also for the future... You should always see your documentation for given error number, in this case searching for LNK2019 would probably give you an example for what you are doing wrong.

Hope this helps...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement