Original Post
I'm having problems getting two classes to get along. Basically each one needs the other in their headers. I am using #pragma once to avoid the natural redefinition errors, but that's not the problem (or at least I don't think it is). (The actual code is fairly large, I'm doing my own GUI library as a learning exercise.) The basic idea is:
#pragma once
#include "B.h"
typedef void (*FUNPTR)(B*);
class A
{
private:
FUNPTR p;
};
-------
#pragma once
#include "A.h"
class B
{
public:
/* stuff */
A an_a;
}; The error I get is "C2460: 'A::FUNPTR' : uses 'A' which is being defined." which doesn't make any sense. Can someone help me with this? Thanks in advance :)