您的位置:首页 > Web前端

error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

2014-09-16 11:33 393 查看
VS2013新建一个空的win32应用程序时 出现了链接错误

1>------ Build started: Project: AutoUpdate, Configuration: Debug Win32 ------

1> Main.cpp

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

1>D:\Projects\AutoUpdate\Debug\AutoUpdate.exe : fatal error LNK1120: 1 unresolved externals

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

具体过程及其解决方法如下

1、新建一个空的WIN32应用程序:



2、加入main函数:



3、直接编译链接出错:



4、加入代码:#include <tchar.h>后编译成功

完成代码如下:

#include <Windows.h>
#include <tchar.h>

int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR    lpCmdLine,
int       nCmdShow)
{
UNREFERENCED_PARAMETER(hInstance);
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
UNREFERENCED_PARAMETER(nCmdShow);

return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐