[Solved] C2027: use of undefined type QDebug

  • Hi all, working an example in the Qt book I have. It shows a line of code that looks like this which is generating the error in the title. Previous to this example in particular, I had used qDebug with data right inside the parens and it worked fine. But this syntax it's not working...

    qDebug( ) << values[i] << "! = " << MathFunctions::factorial( values[i] );

    Any help will be greatly appreciated!

  • Moderators

    To use that syntax, you need to include QDebug header:
    #include <QDebug>

    Without it, only the "inside parentheses" syntax works.

  • Thanks sierdzio! That was exactly what the problem was. I didn't notice the example had added the include statement at the top.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.