I am attempting to compile an incomplete program to try and catch syntax issues before things get too large. That being said, the classes that I have created are all but complete (a few member functions are stubbed), and contained in separate files from the main program. Visual Studio recognizes them as classes (which can be seen by mousing over them).
Now, the problem is that when I try to compile this, I get the following errors:
1>d:\my programs\powerplay\powerplay\powerplay.hpp(99): error C2065: 'pp_player' : undeclared identifier
1>d:\my programs\powerplay\powerplay\powerplay.hpp(99): error C2146: syntax error : missing ')' before identifier 'player'
1>d:\my programs\powerplay\powerplay\powerplay.hpp(99): error C2182: 'resolve_current_space' : illegal use of type 'void'
Line 99 of this file is a function declaration (where pp_player is the larger of my classes, and as stated before, recognized by VS as a class, in the editor anyway):
void resolve_current_space (pp_player& player);
Everything is properly #include ‘d, and there are no problems with the other classes whatsoever. I have tried commenting out this function (declaration and definition), but the compiler chokes on the next function that tries to use an object of this class as an argument. I tried instantiating an object of this class earlier in the file, and while I did not get the exact same error, it more or less amounted to the same thing.
Anyone have an idea as to what this could be? If needed, I can make the entirety of my source available if the above isn’t enough.
There is no declaration of
pp_playerin scope at the point you’re trying to use it, plain and simple, that’s what that error message means.So, despite your assertion that everything is properly included, either that’s not the case, or the things you have included do not declare or define
pp_playerbefore that point.It’s a basic tenet in C and C++ that most things (there are some edge cases in the standards that don’t require this, such as labels) need to be declared before use.
Make sure you define the type before line 99 of the
hppfile.