我自己建的类,然后都分成H和CPP文件了
然后就建了一个空的Win32工程,把自己的CPP和H加进去,一编译就出错,
错误如下
d:\testp\expreesion.cpp(270) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Max.cpp
d:\testp\max.cpp(107) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Generating Code...
Error executing cl.exe.
这是MSDN对错误的解释
unexpected end of file while looking for precompiled header directiveA precompiled header was specified, but it did not contain a precompiled header directive.This error can be caused by specifying an incorrect file as a header file, or by specifying an include file with the /Yu (Use Precompiled Header) command line option that is not listed in the source file as an include file.
这是我加头文件的方式
#include <string.h>
#include <iostream.h>class expreesion
{
public:
.................#include "expreesion.h"void expreesion::Seta0(int a_0)
{
a0 = a_0;
}void expreesion::Seta1(int a_1)
{
......................#include <stdlib.h>
#include <malloc.h>
#include "expreesion.h"#define MAX 3
class Max
{
public:
Max(int r1 , int c1);
.................
#include "Max.h"Max::Max(int r1 , int c1)
{
int i , j; row = r1; col = c1;
........................但是这几个文件在Win32 Console Application下组建成工程后时一点问题都没有,我的目的是编一个运算方面的类,单个单个CPP编的,所有算法实现以后,我要给它做个用户界面,所以建一个Win32 Application,然后把它们加进来,响应消息时执行相关对象的函数。以上就是错误的内容了,先谢谢各位大哥了,帮小弟解答一下吧
然后就建了一个空的Win32工程,把自己的CPP和H加进去,一编译就出错,
错误如下
d:\testp\expreesion.cpp(270) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Max.cpp
d:\testp\max.cpp(107) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Generating Code...
Error executing cl.exe.
这是MSDN对错误的解释
unexpected end of file while looking for precompiled header directiveA precompiled header was specified, but it did not contain a precompiled header directive.This error can be caused by specifying an incorrect file as a header file, or by specifying an include file with the /Yu (Use Precompiled Header) command line option that is not listed in the source file as an include file.
这是我加头文件的方式
#include <string.h>
#include <iostream.h>class expreesion
{
public:
.................#include "expreesion.h"void expreesion::Seta0(int a_0)
{
a0 = a_0;
}void expreesion::Seta1(int a_1)
{
......................#include <stdlib.h>
#include <malloc.h>
#include "expreesion.h"#define MAX 3
class Max
{
public:
Max(int r1 , int c1);
.................
#include "Max.h"Max::Max(int r1 , int c1)
{
int i , j; row = r1; col = c1;
........................但是这几个文件在Win32 Console Application下组建成工程后时一点问题都没有,我的目的是编一个运算方面的类,单个单个CPP编的,所有算法实现以后,我要给它做个用户界面,所以建一个Win32 Application,然后把它们加进来,响应消息时执行相关对象的函数。以上就是错误的内容了,先谢谢各位大哥了,帮小弟解答一下吧
解决方案 »
- 如果改变其他进程的资源
- 大侠都看过来啊,谁有数字图像处理第二版中文版(冈萨雷斯)的源代码啊?
- 怎么设置窗口上的combolist值
- 编了个聊天程序,在局域网内能用,出外网就不行了,为啥呢
- 怎么修改VS2005的起始页不显示,让启动时显示空环境
- can not convert DD* to DD*&, why?
- VC++下如何实现调用系统目录下的命令?急求啊!!!
- 请问:如何对已经存在的位图进行旋转??
- ADO数据库如何删去所有记录(用一条指令)
- How can the multimedia timer synchronous with my app?
- 建立SDI,自己添加菜单为什么显示的时候是灰色
- 如何获取保存在硬盘上的网页内的全部链接! 100分
如果使用Win32 Application的话建议使用第二个模板创建工程,即:a simple win32 application
如果要做界面的话,不要用Win32 application了,比较烦,还是用MFC吧
晕。
如果发生错误的文件原本是该工程中的,则检查该文件头部有没有#include "stdafx.h"语句,没有的话添加。
如果还不行,也有可能是定义的类或结构体等最后忘了加分号,注意一下。
在你的每个实现文件里都包含它
#include "stdafx.h"
如果还不行就再加上
#include "ProjectName.h" //ProjectName.h是指你的工程App的头文件
要么在编译选项里去掉预编译头