请扶新手上路:编译问题
haaa 2002-01-18 10:50:10 我是c++的新手(既菜鸟),一本<<c++大学教程>>(第2版)看了三个月还不知所云,以后少不得麻烦大家,在此先行谢过.下面这问题我就不得其解:
#ifndef TIME1_H
#define TIME1_H
class Time{
public:
Time();
....
private:
...
};
#endif
------------------
#include<iostream.h>
#include "time1.h"
Time::Time() {hour= minute = second =0; }
........
----------------
#include<iostream.h>
#include "time1.h"
int main()
{
Time t;
.....
.....
return 0;
}
(可参考原书fig 06_05)
编译时,总是出现如下提示:
fatal error C1083: Cannot open include file: 'time1.h': No such file or directory
Error executing cl.exe.
不知是什末原因,我是在vc++里编译的,步骤是在vc++里"文件"->"新建"->"文件"(而不是"工程")->"c++ source file"最后再编译既出现上述问题的.另希望看过此书的人能对其做出评价。