Code can't find previously defined class
I have a file that has several class delcarations in it. It looks like
Code:
class A : public B
{
public:
virtual int call (void)
{
stuff;
return -1;
}
};
class C : public D, private E
{
stuff;
};
int C::foo(void)
{
A *req;
return 0;
}
When I try to compile, at "A *req" I get identifier "req" is undefined. But req isn't the identifier, A is. So it looks like it can't find A. But why wouldn't it find it. It's in the same file.
Re: Code can't find previously defined class
Did you forget to put the semicolon on the end of class C?
Re: Code can't find previously defined class
No, sorry. That was just a typo. I fixed it in the edit.
Re: Code can't find previously defined class
Post the smallest and simplest program that demonstrates the error. Also, post the exact error message.
Re: Code can't find previously defined class
Where are D and E? Is this all one file, or did you forget to include something.. or have circular references. Circular references are the hardest to find.
Re: Code can't find previously defined class
I've given up on this error. I was getting it while compiling ACE. From everything I see, it should be compiling fine. But the error was coming from an examples folder, so it's not core code. So I just commented out the refernce to the makefile that compiles the file giving the error and continued on. The only thing I can think of is it is an issue with my compiler.