• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 879
  • Last Modified:

First Program in .Net error LNK2019

Hello,

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!

Adam
0
sporenza
Asked:
sporenza
1 Solution
 
AlexFMCommented:
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.
0
 
sporenzaAuthor Commented:
Yes you are correct.  I think I may have drunk too much wine!
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now