--------------------Configuration: Cpp1 - Win32 Debug--------------------
Compiling...
Cpp1.cpp
c:\documents and settings\administrator\my documents\microsoft visual v++ 6.0\cpp1.cpp(48) : fatal error C1083: Cannot open include file: 'point.h': No such file or directory
Error executing cl.exe.
Cpp1.exe - 1 error(s), 0 warning(s)
下面是程序:
#include <iostream.h>
#ifndef POINT
#define POINT
class point
{
int x,y;
public:
void set_xy(int a,int b)
{
x=a;
y=b;
}
int get_x()
{
cout<<x<<endl;
return x;
}
int get_y()
{
cout<<y<<endl;
return y;
}
};
#endif
//circle.h
#include <iostream.h>
#ifndef CIRCLE
#define CIRCLE
class circle:public point
{
int radius;
public:
void set_radius(int r)
{
radius=r;
}
int get_radius()
{
cout<<radius<<endl;
return radius;
}
};
#endif
//main
#include <iostream.h>
#include "point.h"
#include "circle.h"
int main()
{
point pt;
pt.set_xy(1,2);
pt.get_x();
pt.get_y();
circle cl;
cl.set_xy(3,4);
cl.set_radius(100);
cl.get_x();
cl.get_y();
cl.get_radius();
return 0;
}
包含*.h *.cpp 的程序该怎么编译啊,是分开编译吗,还是要另建项目呢
怎么才可以让这个程序编译成功啊。