我有一个程序,我现在加一个公用函数文档到项目中,出现如下错误,请问是什么原因。function.h如下
#if !defined(public_function_h)
#define public_function_h
void ReadtoList(CListCtrl *p,CString sql);
#endif
function.cpp如下
#include "function.h"
void ReadtoList(CListCtrl *p,CString sql);
{
AfxMessageBox("has Called");
}它会出现如下错误,这是什么原因
unexpected end of file while looking for precompiled header directive
#if !defined(public_function_h)
#define public_function_h
void ReadtoList(CListCtrl *p,CString sql);
#endif
function.cpp如下
#include "function.h"
void ReadtoList(CListCtrl *p,CString sql);
{
AfxMessageBox("has Called");
}它会出现如下错误,这是什么原因
unexpected end of file while looking for precompiled header directive
function.cpp如下#include "stdafx.h" //add mfc must#include "function.h"
void ReadtoList(CListCtrl *p,CString sql)
{
AfxMessageBox("has Called");
}
试修改project->settings->C/C++在category中选择Precompiled Headers
然后将Automatic use of compiled headers选中
确定
然后重新完全编译工程