以下三个文件报错:[Error] ld returned 1 exit status
类的定义(未命名3.h)
class Point
{
public:
Point(int x=0, int y=0):x(x),y(y){}
Point(const Point &p);
~Point(){ count--; }
int GetX() const{return x;}
int GetY() const{return y;}
static void GetC();
private:
int x,y;
static int count;
};
类的实现
#include "未命名3.h"
#include
using namespace std;
int Point::count=0;
Point::Point(const Point &p):x(p.x),y(p.y)
{
count++;
}
void Point::GetC(){
cout<<" Object count="<
}
主函数
#include "未命名3.h"
#include
using namespace std;
int main()
{
Point A(4,5);
cout<<"Point A,"<<A.GetX()<<","<<A.GetY();
A.GetC();
Point B(A);
cout<<"Point B,"<<B.GetX()<<","<<B.GetY();
B.GetC();
return 0;
}
求教为什么无法编译