Walid-Shouman
6/25/2016 - 9:36 AM

some experience in compiling cpp code

some experience in compiling cpp code

C++ splitting

forward declaration and header inclusion

This is what happens when we forward declare without including the header file that includes the type
It sounds there are no way out of circular includes, thus comes the perks of having #ifndef, #define and #endif wrapping all our headers
For the current project, forward declaration is used in the header files to let the classes know about others' existence and later the header files are included in the cpp files
The forward declaration error means we have found a forward declared class yet the class declaration itself wasn't found

voxelmon.cpp: In member function ‘void Voxelmon::initialize_daycarestate_special()’:
voxelmon.cpp:53:23: error: invalid use of incomplete type ‘class CHILD’
   current = new CHILD();
                       ^
voxelmon.cpp:7:7: error: forward declaration of ‘class CHILD’
 class CHILD;
       ^

including from other directories

ensure using / not \ in mapping directories if the file wasn't found