undefined reference is a linker error, indicating the linker could not find implementation for the specific method.
try to add a implementation for you foo constructor in foo.h
Change:
virtual ~Foo();
Foo();
bool foo(void) { return true; }
To
virtual ~Foo();
Foo() {} //add default implementation
bool foo(void) { return true; }