c++ - LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup error when using WinMain -


i've been following tutorial learn directx programming: http://www.rastertek.com/dx11tut02.html

i'd gotten end, tried build , threw error when compiled:

msvcrtd.lib(crtexe.obj) : error lnk2019: unresolved external symbol _main referenced in function ___tmaincrtstartup 

so, googled extensively try find solution, things i've tried included:

-setting entry points winmaincrtstartup, wwinmaincrtstartup , maincrtstartup (probably others too)

-making sure subsystem set windows rather console, tried setting 'console' , 'not set' in case.

-add existing item file containing main method.

-downloaded provided code in tutorial make sure wasn't coding error on part, still didn't work.

now interesting bit:

i tried downloading tutorial code desktop (which don't have access to, being away) has copy of visual c++ express 2010 (my laptop running visual studio 2010 professional). worked absolutely fine on desktop, first time, didn't have change single setting.

so problem must install of vs on laptop, or else laptop.

i've tried resetting vs settings default, uninstalling vs, doing repair install, installing visual c++ express, installing windows sdk v7.1, think of , still doesn't work.

just clear, code i'm using main is:

int winapi winmain(hinstance hinstance, hinstance hprevinstance, pstr pscmdline, int icmdshow) 

please help, i've spent 2 days messing around , not gotten anywhere, i'm on verge of trying reinstall windows completely.

i ran similar problem today.

my main.cpp wasn't being included in build correctly.

go solution explorer, right click on file , select "properties".

make sure that

  1. the file included in build and
  2. the tool set c/c++ compiler tool.

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -