Advertisement

MSVC error

Started by August 18, 2000 06:00 AM
1 comment, last by Mr Cucumber 24 years, 4 months ago
MSVC error I get the error: ''blabla'' uses undefined class ''Blabla''. The situation is this that I have one header where I define the class Blabla. I have another class in another header that has an instance of the class Blabla and this is the point the error is pointing to. I wrote this code to see if I got the error and I did (it can''t be linked but that tdoesn''t matter):
    class num2;

class num1
{
public:
	num2 n;
	int metod(void);
};

class num2
{
public:
	num2(void);
	int fff(void);
};

int num2::fff(void)
{
	return 1;
}

void main(void)
{	
}    
What causes the error?
did you #include the header containing the definition of Blabla in the header containing the instance?
Advertisement
If you''re declaring a non-pointer member of a class you must have its full definition before that declaration. You need to cut the definition of "num2" and paste it above the definition of "num1."

This topic is closed to new replies.

Advertisement