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:
Code:
#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();
}