0
#include <windows.h> 

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,nShowCmd)
{
    MessageBox(NULL, L"Hello World!", L"Just another Hello World program!", MB_ICONEXCLAMATION | MB_OK);
    return 0;
}

Working through a tutorial for getting started with c++ and can't get the first hello world example to compile.

Using visual studio express 2012. All I've done is create a new project and copy this into it replacing the tmain function.

please does anyone know how to resolve this?

Oli
  • 39
  • 1
  • 1
  • 6
  • [Try this thread](http://stackoverflow.com/questions/4845410/error-lnk2019-unresolved-external-symbol-main-referenced-in-function-tmainc?rq=1) – ben4808 Dec 22 '13 at 21:29

1 Answers1

0

In standard C++ program you must have main function so program knows where to start

int main()
{
   return 0;
}

Maybe try another tutorial. This one seems good. http://blogs.msdn.com/b/devschool/archive/2013/01/08/writing-your-first-c-program-using-visual-studio-2012.aspx

InflexCZE
  • 722
  • 1
  • 14
  • 30