Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] C2027: use of undefined type QDebug
Forum Updated to NodeBB v4.3 + New Features

[Solved] C2027: use of undefined type QDebug

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 9.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RickBlacker
    wrote on last edited by
    #1

    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!
    Thanks
    Rick

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

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

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

      (Z(:^

      1 Reply Last reply
      0
      • R Offline
        R Offline
        RickBlacker
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved