Had a similar problem with this error code where the compiler couldn't compile to create a stack<some_class>. The solution was to move the inclusion of the include into a ".H" file instead of directly of in the CPP file. The some_class definition and the creation of the stack variable didn't move. Took me a day to figure this out, so I hope it helps somebody else!