📄 subject_21532.htm
字号:
<p>
序号:21532 发表者:yingpf 发表日期:2002-11-18 14:40:25
<br>主题:奇怪!?
<br>内容:总是在.CPP文件的最后一行报这个错,不知是何原因:<BR>fatal error C1010: unexpected end of file while looking for precompiled header directive<BR><BR>.H文件如下:<BR>#include <String.h><BR><BR>#ifndef _STUDENT_H_<BR>#define _STUDENT_H_<BR><BR>class Student<BR>{<BR>private:<BR> CString m_strNumber;<BR> CString m_strName;<BR> bool m_bSex;<BR> int m_iAge;<BR>private:<BR> Student(void);<BR> Student(CString &strName, CString &strNumber);<BR> ~Student(void);<BR>public:<BR> int GetAge(void);<BR>};<BR>#endif<BR><BR>CPP文件如下:<BR><BR>#include "student.h"<BR><BR>Student::Student()<BR>{<BR>}<BR><BR>Student::Student(CString &strName, CString &strNumber)<BR>{<BR> m_strName = strName;<BR> m_strNumber = strNumber;<BR>}<BR><BR>int Student::GetAge()<BR>{<BR> return m_iAge;<BR>}<BR><BR>Student::~Student()<BR>{<BR><BR>}<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:CDMA2000 回复日期:2002-11-18 14:41:34
<br>内容:在最前面加上#include "stdafx.h"
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:yingpf 回复日期:2002-11-18 14:46:36
<br>内容:为何每一个.CPP文件,都要#include "stdafx.h"呢??
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:CDMA2000 回复日期:2002-11-18 14:53:34
<br>内容:stdafx.h包含了标准的系统包含文件和工程中哪些经常使用但很少改动的包含文件,将这些文件预编译,产生预编译头文件,可以节省每次编译的时间!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -