I am having trouble compiling my code with QDebug, but i really need it.
#include <QCoreApplication>
#include <QtDebug>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QDebug() << "hello";
return a.exec();
}
This is an example of the error i got on this simple test: no matching function for call to 'QDebug::QDebug()'
For version 5.15 of Qt following worked for me,
add include file,
#include <QDebug>
and use,
qDebug() << "Your debug message.";
Try this:
qDebug() << "hello";
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With