I have Class A extending Class B and implementing Interface C. B accesses a protected var x from A. But the compiler is telling me that x is not declared in this scope. The code looks like
Sender.h
Code:
#include "properties.h"
class Sender
{
public:
Sender(Properties p);
protected
int sock;
int getSocket();
};
MyListener.h
Code:
#include "sender.h"
class MyListener : public Sender, public Listener
{
public:
void on_ready();
int getSocket();
};
MyListener.cpp
Code:
#include "mylistener.h"
int MyListener::getSocket()
{
return sock;
}
Compiling MyListener.cpp causes a "'sock' was not declared in this scope" error.