Issue
I have a QT application written in C++, but at one point it makes a call to a function in a C library.
I would like the C function to display to the output for debugging purposes. However qDebug()
can’t be called in C.
Is there an alternative to qDebug()
that can be used in C? I’ve tried printf()
but it doesn’t seem to display anything.
printf("Test output");
IDE is QT Creator and I’d like the output to be displayed in the "Application Output" pane.
Solution
After calling printf
, add a call to fflush(stdout)
. That should fix the problem.
Answered By – JarMan
Answer Checked By – David Marino (BugsFixing Volunteer)