搜索
您的当前位置:首页MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in functi

MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in functi

来源:乌哈旅游

编译出现:

MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

 

产生此类问题的原因是:

1. 当程序的main函数是

     int main(){}

这样的写法,system 的SubSystem就是/SUBSYSTEM:CONSOLE

2. 当程序的main函数是

     int main(int argc, char* argv[]){}

这样的写法,system 的SubSystem就是/SUBSYSTEM:CONSOLE

 

主要是因为main函数的入口和subsystem不匹配才会出现上面提及的问题。

 

结论:

当main函数的入口和subsystem不匹配时,一旦编译就会出现如下问题:

MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

 

解决方法:

1、修改main函数

2、重设subsystem参数:

Project -> xxxx Properties -> Configuration Properties -> Linker -> System—>SubSystem

 

因篇幅问题不能全部显示,请点此查看更多更全内容

Top