First Program in .Net error LNK2019


I am running my first program in .NET on a new computer with .NET just installed.  I am using Visual C++ .NET Step-By-Step.  I am writing the first program, very basic!!

my program:

#include <iostream>
using namespace std;

int main()
      cout <<"Hello, World!" <<endl;
      return 0;

my error:
LIBCD.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup

I think it has to do something with with a registered library, not sure.

Please help!!

Thanks in advance!

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Create new project of type "Win32 Console Application". Your project has another type, and linker tries to find WinMain function and not main function.
See also: /SUBSYSTEM linker option. You need /SUBSYSTEM:CONSOLE and not /SUBSYSTEM:WINDOWS.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sporenzaAuthor Commented:
Yes you are correct.  I think I may have drunk too much wine!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual C++.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.