求大神帮我看看怎么修改
下面是部分代码
Line.cpp
#include<iostream>
#include"Line.h"
using namespace std;
Line::Line(int x1, int y1, int x2, int y2) :m_coorA(x1,y1), m_coorB(x2, y2)
{
cout << "Line()" << endl;
}
Line::~Line()
{
cout << "~Line()" << endl;
}
void Line::setA(int x, int y)
{
m_coorA.setX(x);
m_coorA.setY(y);
}
void Line::setB(int x, int y)
{
m_coorB.setX(x);
m_coorB.setY(y);
}
void Line::printInfo()
{
cout << "printInfo()" << endl;
cout << "("m_coorA.getX() << "," << m_coorA.getY() << ")" << endl;
cout << "("m_coorB.getX() << "," << m_coorB.getY() << ")" << endl;
}
void Line::printInfo() const
{
cout << "printInfo()const" << endl;
cout << "("m_coorA.getX() << "," << m_coorA.getY() << ")" << endl;
cout << "("m_coorB.getX() << "," << m_coorB.getY() << ")" << endl;
}
Line.h
#include"Coordinate.h"
class Line
{
public:
Line(int x1, int y1, int x2, int y2);
~Line();
void setA(int x, int y);
void setB(int x, int y);
void printInfo();
void printInfo() const;
private:
const Coordinate m_coorA;
Coordinate m_coorB;
};
前两个黑体部分错误提示:不兼容的类型限定符;
后四个黑体部分错误提示:未找到用户定义的文本运算符。