I am new in c++ and have a problem that I could not solve. I wrote a very simple class and put it in a header file. Below are the files:
point.h:
// point.h
#include <iostream>
#ifndef _POINT_H_
#define _POINT_H_
using namespace std;
class Point{
    private:
        double x;
        double y;
    public:
        void generate(double a, double b);
        void print();
};
#endif 
point.cpp:
// point.cpp
#include <iostream>
#include "point.h"
using namespace std;
void Point::generate(double a, double b) {
    x = a;
    y = b;
} 
void Point::print() {
    cout << x << endl;
    cout << y << endl;
}
main.cpp:
// main.cpp
#include <iostream>
#include "point.h"
using namespace std;
int main() {
    Point A;
    A.generate(1,2);
    A.print();
    return 0; 
}
Every time I compile main.cpp I get the error:
main.cpp:(.text+0x30): undefined reference to `Point::generate(double, double)'
main.cpp:(.text+0x3c): undefined reference to `Point::print()'
[Error] ld returned 1 exit status
What have I done wrong? Hope for answers ;).
Greetings, Gerald
