I tried to create a class for 3-D vector in c++, but there are some errors. I have learnt a little bit of oop in python before, but I'm still pretty new to oop and c++. I created the header file threevector.h, the file for the class threevector.cpp and the main program file main.cpp. I just want to know what I have done wrong.

```
// threevector.h
#ifndef THREEVECTOR_H
#define THREEVECTOR_H
#include <iostream>

class threevector {
    private:
        double xcoord, ycoord, zcoord;

    public:
        threevector();
        threevector(double x, double y, double z, char type);
        void print ();      
};
#endif // THREEVECTOR_H

//threevector.cpp
#include "threevector.h"
#include <cmath>

threevector() {
    xcoord = 0.0;
    ycoord = 0.0;
    zcoord = 0.0;
}

threevector(double x, double y, double z, char type) {
    if (type == 'c') {
        // cartesian coordinate
        xcoord = x;
        ycoord = y;
        zcoord = z;
    } 
    else if (type == 'p') {
        // polar coordinate
        // x = r, y = phi, z = theta
        xcoord = x*sin(y)*cos(z);
        ycoord = x*sin(y)*sin(z);
        zcoord = x*cos(y);
        }
}

void print () {
    std::cout << xcoord << '\t' << ycoord << '\t' << zcoord << std::endl;
}

// main.cpp
#include "threevector.h"
#include <cmath>
#include <iostream>

using namespace std;

int main() {
    threevector v0;
    v0.print();

    threevector v1(-1,2,4.384,'c');
    cout << "v1 = ";
    v1.print();

    return 0;
}

```

The following are the error messages I get:

```
main.cpp(.text+0x15): undefined reference to 'threevector::threevector()'
main.cpp(.text+0x15): undefined reference to 'threevector::print()'
main.cpp(.text+0x15): undefined reference to 'threevector::threevector::threevector(double, double, double, char)'
main.cpp(.text+0x15): undefined reference to 'threevector::print()'
[Error] ld returned 1 exit status

```