You should include pegclass.h and iostream in pegclass.cpp
#include "pegclass.h"
#include <iostream>
using namespace std;
In pegclass.h you really shouldn't include any source file, so remove
#include "pegclass.cpp" // <-- REMOVE THIS!!!
from pegclass.h. Including source in header files is a really bad practice.
Same for vector.h: do not include vector.cpp from its header.
#include "vector.cpp" // <-- REMOVE THIS!!!
After all these changes, the code compiles.
But it still does not link.
After some looking at the code, I remembered that if you do generics (template), you cannot separate your generic class into a header (.h) and code file (.cpp). This is a thing with generics and has to do with how the actual code with the actual type is generated from the templates.
So what you need to do is keep the generic class (vector) in one file. In practice it means that you just have a vector.h that contains not only the declaration but the definition as well, no separate vector.cpp
I've changed your code and now it compiles and runs: https://onlinegdb.com/SJzFUHup8
Note: I didn't go beyond compilation and running, I did not validate if your program works correctly.