C2065 identifier undeclared
-
26-09-2019 - |
Question
In my Service.h I have:
#include "Configuration.h"
and in my class:
private:
ConfigurationInterface* configuration_;
Then, in my Service.cpp:
Service::Service(Foundation::Framework* framework) :
framework_(framework)
{
configuration_ = new Configuration();
}
and later...
const Info GetInfo()
{
return configuration_->getInfo();
}
I get undeclared identifier error.... (configuration_)
Why¿?
EDIT: As Cedric H. said: "ConfigurationInterface is an abstract class and Configuration inherit from it"
Solution
Change
const Info GetInfo()
to
const Info Service::GetInfo()
OTHER TIPS
configuration_ = new ConfigurationInterface();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow