how to run a linked program?

I don't fully understand how to run a linked program in unix?

I have a total of three programs, one is the interface program.h, the second one is the definition program.cpp and third program which is the test testProgram.cpp
I compiled each individually fine.
In program.cpp, I wrote #include "program.h" and I also did this in testProgram.cpp, but when I run it in Unix as g++ testProgram.cpp, it gives me the following error : "undefined reference to"
¿undefined reference to...?
http://www.cplusplus.com/forum/general/113904/

$ g++ testProgram.cpp program.cpp -o test.bin
$ ./test.bin
Topic archived. No new replies allowed.