DIGIT-ARC read-only archive · snapshot: July 23, 2026

Visual CPP lnk2019 error

1 post · originally from https://geek.digit.in/community/threads/visual-cpp-lnk2019-error.185369/

E
e33tad Original post #1
Jul 6, 2014 at 8:30 PM
I am just getting started with visual cpp 2013 . I looked around the web for tutorials and tried running the following code
Code:
#include <windows.h>
#include <tchar.h>

int WINAPI winMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd)
{
	MessageBox(NULL, _T("Hello World"), _T("A Sample Application"), MB_ICONINFORMATION);
	return 0;
}

It throws the following error
Error 1 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup C:\Users\......\MSVCRTD.lib(crtexew.obj) SampleApp

can anyone tell me whats am i doing wrong here and can someone site for suggest latest tutorials (not msdn though).