issues with #includes

Hello, I’m having some trouble sorting out some #includes. My directory structure looks like this:

  
  
testApp.cpp  
testApp.h  
main.cpp  
  
A  
-- classA.h  
-- classA.cpp  
  
B  
-- classB.h  
-- classB.cpp  
  

In testApp.h, I’m importing both classA.h and classB.h. However, I also want classA to have a pointer to classB and vice versa. When I add "#include “classB.h” to classA.h (and the opposite to classB.h) I get issues with “classA/classB has not been declared”. I’m using #pragma once at the top of all of these files as an include guard, so I would guess that this is causing my problems.

Is what I want to do frowned upon / bad form? What’s the proper way to be doing this?

it has nothing to do with the pragma once, it’s a problem called recursive inclusion, it’s solved by using forward declaration. take a look at this post, it explains how to solve it:

http://forum.openframeworks.cc/t/include-problem/3063/0

Thanks a lot, that worked.