"Pointer to incomplete class type is not allowed"
.h file includes:
.cpp file function snippet:
Above is part of my code and the problem I am having is that VS is underlining the "EC" variable in the "SavedVelocity" definiton (last line) in red, telling me that "Pointer to incomplete class type is not allowed". I am quite new to C++ in Unreal and I have no idea why I am getting this error. I have searched around on Google for this issue and all the answers basically tell them that they forgot to include a certain engine component. However I can't think of what I could have possibly forgotten to include here. "EC" here is just a pointer to the "PTZRCharacter" class (a custom character class I made) and I have indeed included the header file of that class in my header file.
I can't possibly think of anything else I need to include. Any ideas?
asked Apr 06 '19 at 06:34 PM in C++ Programming
Normally when declaring a class variable in a header file it is done by what is known as "Forward Declaration".
So make sure that you completed the declaration and not only made a forward declaration to the APTZRCharacter class. You always want to include as few things as possible in a header file so it is lighter when other classes need to include it. When declaring a pointer variable it doesn't need to know what the class consist of and can be handled as any other generic pointer UNTIL you want to use the type the pointer points to.
Follow this question
Once you sign in you will be able to subscribe for any updates here