Quote:Original post by SirLuthor
Oh. my. god. I hate it when I do that... Such a simple mistake, I probably never would have found it, if not by pure chance of having encountered something sort of like this a while back, which I had forgotten about.
Apparently, the problem was this: In the shared header, Ascendancy.hpp, the ASC-EntryTask.hpp was included above the ASC-Task.hpp file, which would lead to the 'EntryTask' class inheriting from a class not even declared when EntryTask was declared..
Of course, simple beginner's mistake as it was, that was a very vexing experience.. And I still can't figure out why it borked all my curly braces [smile].... Cheers folks, and thanks for the input! Apparently, #include'ing in alphabetical order is not always the optimal setup :D
:)
To avoid this problem, you should #include "ASC-Task.hpp" in ASC-EntryTask.hpp. This costs nothing - well, maybe some compiler time, but I bet a difference of 20 milliseconds per file will not hurt you - and avoid this kind of errors.
One rule I always follow: if class B inherits from class A, then the declaration file of B includes the declaration file of A.
Regards,