You know, it would actually be easier with a makefile. I am not sure how you create the file in vim, but just call it "makefile" it doesn't need an extension and this would be what it would look like.
Date: DateTest.o CDate.o
g++ DateTest.cpp CDate.cpp -o Date
DateTest.o: DateTest.cpp CDate.cpp
g++ -c DateTest.cpp
CDate.o: CDate.cpp CDate.h
g++ -c CDate.cpp
Where DateTest is your test file, or main program file, and CDate is your class definition file and CDate.h is your class header file. The Date: in the top left is the name of the executable file that will be left over. Then what you do after you have modified this file to match your files, the command you use is
and it will create a file with the name that you put in the top left corner. And to run your program you would type ./Date unless linux is automatically set up to look in the file you are coding in.