Errors LNK2019 and LNK 1120

2019-03-03 12:14发布

问题:

I keep getting the same error when I try to compile my program (http://pastebin.com/TABk4bya). The error says -

1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

1>c:\users\logan\documents\visual studio 2012\Projects\Assignment 09\Debug\Assignment 09.exe : fatal error LNK1120: 1 unresolved externals

I have tried to search but I cannot seem to find out what the problem is.

P.S. I have pasted it to pastebin so you can easily see/point out which lines the error is on. Thank You!

回答1:

You have

int Main()

it should be

int main()

Case matters! Main is not the same as main.