views:

582

answers:

4

This is a very frustrating error message in Qt Creator: ’XYZ’ does not name a type. This usually means that there is an error in the class XYZ that prevents the compiler from generating the type, but there are no additional hints as to what went wrong.

Any suggestions?

A: 

Does #include'ing the corresponding header file help?

Dirk Eddelbuettel
No, I made sure I've included it.
Jen
Could you please post a full example that is self-contained so that we can actually look at something? May beat guessing :)
Dirk Eddelbuettel
I don't know what to look for ... this is happening in a project with 100's of files.
Jen
A: 

If you're using templates, then you need to precede the class name with "typename" so that the compiler can recognize it as a type...

template <typename t> //...
Aviral Dasgupta
Thanks, but not using a template...
Jen
A: 

Do you get the error from the compiler or the IDE (as a squiggly underline)? I've encountered this in Qt Creator 1.2.9 and I think it's a bug in the IDE.

rpg