I can't believe I'm writing this... just #include <abc.cpp> right above the main() function in your test.cpp file.
Code:
...
class P
{
};

#include "abc.cpp"

int main()
{
  ...
}
Then compile your application like:
Code:
g++ test.cpp