1st Program Failed - fatal error LNK1120

So I'm a wannabe C++ programmer who just got started with Microsoft Visual C++ 2010 Express. I wrote my "Hello World!" program, but it failed. This is exactly what I wrote:

1
2
3
4
5
6
7
8
9
10
// my first program in C++

#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!";
  return 0;
}


And this is the exact output it gave me:

1>------ Build started: Project: my_first_cpp_project, Configuration: Debug Win32 ------
1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
1>c:\users\jake\documents\visual studio 2010\Projects\my_first_cpp_project\Debug\my_first_cpp_project.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I've searched around online for the solution, and the most common problem is that the programmer forgot the main (), but I included that. The other problem is something to do with the "linker" not being able to find the "library", but that's where I get lost. I apologize for my utter ineptitude, but I really have no experience with programming in any language whatsoever. All I know is created a new file, entered the code, and it failed. Help?
try using
// my first program in C++
1
2
3
4
5
6
7
8
9
10
#include"stdahx.h"
#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!";
  system("pause");
  return 0;
}

i used and don't have any error
good luck
Last edited on
Topic archived. No new replies allowed.