Hi guys,

So I'm trying to kinda do a Java thing with C++ which is apparently capable. I'm trying to pass a reference of a base abstract class to a different class and then make it a shared_ptr, like this:

Code:
SimpleApplication.cpp:
   mp_stateManager = std::make_shared<managers::AppStateManager>(*this);

AppStateManager.cpp:
    AppStateManager(gyroInterface::GyroApplication& app) :
    mp_app(std::make_shared<gyroInterface::GyroApplication>(app) {
        //...
    }
GyroApplication is a pure abstract class.

When I run this code in Netbeans I get the following error:

"note: in instantiation of function template specialization"

But when I do this:

Code:
    AppStateManager(gyroInterface::GyroApplication& app) {
        gyroInterface::GyroApplication* diffApp = &app;
    }
It works... Am I missing something? Or am I making a stupid mistake that new people tend to make?

Cheers Guys!

Jamie.