Today I experienced a very strange compiler issue. I started the compilation and it outputted that a member object of a class was undefined. After about 4 hours of trying the find the bug I commented and then uncommented said line of code that was undefined. Sure enough the compilation worked just from commenting and uncommenting.
I am using Microsoft visual studio 2012 express. Due to the size of the project, I should know the cause because it may cause more problems further down the line. I feel that it might have something to do with the compiler not having a proper order of compilation for the header files and that I might need something to solidify the way that the header files are processed.
The below code is a fragment of a header file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
class CInGameSection: public CBaseGameSection
CInGameSection(bool isInEditor, bool creatingNew, COutput& output, string saveSlot, string regionName, horiVertiVals * widthAndHeight);
bool update(CInput & input, CAudio & audio, COutput & output);
void output(CInput & input, CAudio & audio, COutput & output);
CInGameManager * getManager();
CInGameManager manager;//VERY VERY UNSTABLE ON COMPILATION, comment and uncomment to compile...