View Single Post
dduardo
dduardo is offline
#2
Oct30-04, 09:38 AM
Emeritus
dduardo's Avatar
P: 1,919
You might be running into the infamous nested problems with the Microsoft compiler. You'll need to either upgrade to version VC++ 7.0 or use GCC.

Here is some example code that works under GCC:

#include <iostream>

using namespace std;

class foo {

protected:

        struct foo1 {
                int x;
        };

        struct foo2 {
                foo1 myfunction(void) ;
        };

public:
        void myfunction2(void) ;

};

void foo::myfunction2(void) {
foo2 test ;
test.myfunction();
}

foo::foo1 foo::foo2::myfunction(void) {
cout << "hello\n";
}

int main (void) {

foo testme;

testme.myfunction2();

}