Include screen.h into a file, where you have undefined reference to MainScreen constructor.