Jon Funk
October 25th, 2000, 06:38 PM
I'm experiencing the following error. Can anyone help?
--------------------Configuration: test - Win32 Release--------------------
Compiling...
test.cpp
D:\crud\test.cpp(17) : error C2248: 'Method' : cannot access protected member declared in class 'Outer::Inner'
D:\crud\test.cpp(5) : see declaration of 'Method'
D:\crud\test.cpp(17) : error C2352: 'Outer::Inner::Method' : illegal call of non-static member function
D:\crud\test.cpp(5) : see declaration of 'Method'
Error executing cl.exe.
test.exe - 2 error(s), 0 warning(s)
class Outer {
public:
class Inner {
protected:
void Method() { /* Do nothing */ };
};
};
class Derived : public Outer::Inner {
public:
void Function();
};
void
Derived::Function()
{
Outer::Inner::Method();
}
int main(int, char **)
{
Derived instance;
instance.Function();
return (0);
}
--------------------Configuration: test - Win32 Release--------------------
Compiling...
test.cpp
D:\crud\test.cpp(17) : error C2248: 'Method' : cannot access protected member declared in class 'Outer::Inner'
D:\crud\test.cpp(5) : see declaration of 'Method'
D:\crud\test.cpp(17) : error C2352: 'Outer::Inner::Method' : illegal call of non-static member function
D:\crud\test.cpp(5) : see declaration of 'Method'
Error executing cl.exe.
test.exe - 2 error(s), 0 warning(s)
class Outer {
public:
class Inner {
protected:
void Method() { /* Do nothing */ };
};
};
class Derived : public Outer::Inner {
public:
void Function();
};
void
Derived::Function()
{
Outer::Inner::Method();
}
int main(int, char **)
{
Derived instance;
instance.Function();
return (0);
}