MFC程序运行错误
e:\vc++(揣锦华)\练习\mysdi\mysdidoc.cpp(4) : fatal error C1083: Cannot open precompiled header file: 'Debug/Mysdi.pch': No such file or directory执行 cl.exe 时出错.
源程序如下:完全按照书上的代码写的,可是运行总是出现上面的错误,不知为什么,谁能具体说一下错在哪里,怎么办,多谢了
#include "StdAfx.h"
#include "Mysdi.h"
#include "MysdiDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMysdiDoc
IMPLEMENT_DYNCREATE(CMysdiDoc, CDocument)
BEGIN_MESSAGE_MAP(CMysdiDoc, CDocument)
//{{AFX_MSG_MAP(CMysdiDoc)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMysdiDoc construction/destruction
CMysdiDoc::CMysdiDoc()
{
// TODO: add one-time construction code here
}
CMysdiDoc::~CMysdiDoc()
{
}
BOOL CMysdiDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
m_Str="Welcome to ADI!";
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMysdiDoc serialization
void CMysdiDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
{ar<<m_Str;}
}
else
{
// TODO: add loading code here
{ar>>m_Str;}
}
}
/////////////////////////////////////////////////////////////////////////////
// CMysdiDoc diagnostics
#ifdef _DEBUG
void CMysdiDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CMysdiDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMysdiDoc commands