-2

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"

legami
  • 1,203
  • 6
  • 21
  • 30

2 Answers2

3

Change

const Info GetInfo()

to

const Info Service::GetInfo()
erik
  • 1,218
  • 2
  • 12
  • 23
  • Without the class qualification on the function the compiler thinks this is a global function rather than a class member function, and therefore it has no idea what configuration_ is supposed to be. – Steve Townsend Sep 01 '10 at 11:28
0

configuration_ = new ConfigurationInterface();

Alex F
  • 40,884
  • 40
  • 141
  • 206