|
蓝森林 http://www.lslnet.com 2006年6月6日 10:18
"stdafx.h" 为何打不开,跪求高手相助
#include <iostream>
#include "stdafx.h"
#include <string.h>
class numbers
{
int i;
char str[100];
public:
numbers(int j,char *ptr)
{
i=j;
strcpy(str,ptr);
}
void operator **();
void display();
{
cout<<str<<"is "<<i<<"yours old\n";
}
};
void numbers::operator **()
{
i++;
}
int main()
{
numbers dem(12,"Íõ±ø");
dem.display();
**dem;
dem.display();
return 0;
}
竟然出现这样的出错信息
e:\liguo\qw.cpp(2) : fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
Error executing cl.exe.
出现上述原因我不知所措,希望您能指点迷津,小弟不胜感激! |
stdafx是vc中的预编译头文件,如果找不到的话也许是没有提供,可以在源代码中去掉这个include |
回复 2楼 converse 的帖子
多谢,可是我试过把include给删掉,error反而更多。拜托,你再想想问题出在哪。 |
#include ""只是表示从本目录开始查找,然后再查找系统默认路径,
可能是你的这些路径下根本没有此文件。
那么找到文件的位置,然后写全路径试试——#include "全路径/....h" |
| |