Friday, January 30. 2009

g++ error message: 'non-class type'

Who's designing the error messages of g++? Anyways, here is a translation:

error: request for member ‘foo’ in ‘((Test*)this)->Test::_bar’, 
which is of non-class type ‘C_bar*’

means: in class Test, you've written, but _bar is a pointer; you need to write _bar->foo, that is, change the dot to an arrow.

Happy C++ coding!