(Compiler Error) Pointer to incomplete class type not allowed

I have a place in my code where I'm using the syntax:


someClassPtr is initialized with dynamic memory, and the method someClassMethod() is defined in the .h file and .cpp files correctly.  

I get the error "Pointer to incomplete class type is not allowed.    error #393"

Is there any common reason for this error -- any hints about where I may have made my typo? (I can't really post the code given the work nature, but I was hoping that someone could suggest a reason this error appears in code in general.)

Thanks for the help in advance!

LVL 12
Who is Participating?
evilrixConnect With a Mentor Senior Software Engineer (Avast)Commented:
it means the compiler hasn't seen the full definition of someClass at the point you try and use a member. Have you forward declared in the header and forgotten to include the header file for someclass in the .cpp file maybe?
w00teAuthor Commented:
Good call, thank you evilrix :)
w00teAuthor Commented:
Worked perfectly.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.