QT 5.0 QDebug compilation error

前端 未结 3 2010
无人及你
无人及你 2021-01-11 15:58

I am having trouble compiling my code with QDebug, but i really need it.

#include 
#include 
int main(int argc, char          


        
相关标签:
3条回答
  • 2021-01-11 16:21

    For version 5.15 of Qt following worked for me,

    add include file,

    #include <QDebug>
    

    and use,

    qDebug() << "Your debug message.";
    
    0 讨论(0)
  • 2021-01-11 16:34

    Try this:

    qDebug() << "hello";
    
    0 讨论(0)
  • 2021-01-11 16:36

    The problem here is that QDebug does not have a default constructor. QDebug() << "hello"; would work if it did have one.

    These are the available constructors:

    QDebug(QIODevice* device);
    QDebug(QString* string);
    QDebug(QtMsgType type);
    // and the copy constructor of course.
    

    duDE's answer gives you what you're looking for.

    0 讨论(0)
提交回复
热议问题