Hi. I'm having some problems with my code. Please, could you correct it?
Ex21.cpp:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <iostream>
#include "Point.h"
int main()
{
Point piste1;
piste1.setXY(1,3);
Point piste2(12, 23);
Point piste3(piste2);
system("PAUSE");
return 0;
}
class Point
{
public:
Point();
Point(int xx, int yy);
//third constructor
Point(const Point &c);
~Point();
void setXY(int xx, int yy);
void setX(int xx);
void setY(int yy);
int getX();
int getY();
void printPoint();
private:
int x;
int y;
};
The compilation must first generate object file from each *.cpp file and then the linker has to access both object files (and necessary libraries) to produce the executable.
You have code for the methods, so the build rules probably do not include the Point.cpp (and/or corresponding object file). The fix depends on your build environment.