LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

前端 未结 12 2014
广开言路
广开言路 2020-12-02 18:36

I have the following error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup,

There are a lot of threads relating to this error bu

12条回答
  •  北海茫月
    2020-12-02 19:36

    In my case, it's because I accidentally removed (not deleted) the stdafx.h and targetver.h files in the Header Files section.

    Add these files back to Header Files and the problem is solved.

    I had these:

    #pragma comment( linker, "/entry:\"mainCRTStartup\"" ) // set the entry point to be main()
    

    I just need to comment that (by prepending //) and it's good.

提交回复
热议问题