fatal error C1083: Cannot open precompiled header file: 'Debug/2_1.pch': No such file or directory

fatal error C1083: Cannot open precompiled header file: 'Debug/2_1.pch': No such file or directory

看下面的一段代码:

#include<stdafx.h>
#include<windows.h>
#include<resource.h>


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

//使用应用程序句柄
const int MAXSIZE_APPBUF = 256;
TCHAR wAppTile[MAXSIZE_APPBUF];
LoadString(hInstance,IDS_APP_TITLE,wAppTile,MAXSIZE_APPBUF);

//获取桌面的句柄。
HWND hWnd = GetDesktopWindow();

//显示一行消息。
MessageBox(hWnd, _T("第一个应用程序"), wAppTile, MB_OK);

//
return 0;
}

提示信息说#include<stdafx.h>这行有错。

原文地址:https://www.cnblogs.com/youxin/p/2427502.html