FS#40583 - [qtcreator] [qt5-base] QtCreator with Qt 5.3.0-3 does not show output of the qDebug() function.
Attached to Project:
Arch Linux
Opened by Alex (nylocx) - Wednesday, 28 May 2014, 12:45 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Saturday, 16 August 2014, 20:26 GMT
Opened by Alex (nylocx) - Wednesday, 28 May 2014, 12:45 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Saturday, 16 August 2014, 20:26 GMT
|
Details
Description:
Qt Creator 3.1.1-1 with current Qt 5.3.0-3 does not show output of the qDebug() function. hunger in the #qtcreator IRC channel could confirm this behaivor and that it is fixed by using his self build Qt from current git stable branch. As a simple test this code can be used: #include <QApplication> #include <QTimer> int main(int argc, char *argv[]) { QApplication a(argc, argv); qDebug("Test 1,2,3"); QTimer::singleShot(1000, Qt::CoarseTimer, qApp, SLOT(quit())); return a.exec(); } ----------------------------- OUTPUT ------------------------------- Starting /home/alex/projects/DebugTest-Qt_5-Debug/DebugTest... /home/alex/projects/DebugTest-Qt_5-Debug/DebugTest exited with code 0 |
This task depends upon
Closed by Sven-Hendrik Haase (Svenstaro)
Saturday, 16 August 2014, 20:26 GMT
Reason for closing: Fixed
Saturday, 16 August 2014, 20:26 GMT
Reason for closing: Fixed
QtCreator 3.1.1
Also changing the name (it was just the name that was wrong) in the kit settings of qtCreator did not solve anything.
While writing I just downloaded the binary builds from the qt project (http://download.qt-project.org/official_releases/qt/5.3/5.3.0/qt-opensource-linux-x64-5.3.0.run).
And it works fine with the qtCreator from stock arch repository!
So maybe its a GCC 4.9 problem?
I'm currently recompiling qt creator with gcc 4.9 to see if it makes any difference.
(Update)
No change with a rebuild of qtcreator.
Work-arounds:
1) In project settings, toggle the «run in terminal» checkbox. Each application would run in a terminal that shows the debug output. Not very pretty, but it works.
2) Just launch manually from terminal.
wget http://download.qt-project.org/official_releases/qt/5.3/5.3.0/qt-opensource-linux-x64-5.3.0.run
chmod +x qt-opensource-linux-x64-5.3.0.run
./qt-opensource-linux-x64-5.3.0.run
Install qt
Add new Qt version in QtCreator and apply
Add new Kit in QtCreator using the new 5.3 version.
... Wait for a fix for this Problem ;)
Thanks for your help, ChAlkeR also !
It's really strange I tested this on 5 different arch installs and it works everywhere. Are you sure you build your application with the new Kit? Maybe you could remove your shadowbuild directory or even your pro.user file and start over with the new Kit?
The qDebug() output is back now :)
QtCreator 3.1.1
qt5-base 5.3.0-3
it should but it is not! Still the same with qtcreator 3.1.1-1 and qt5-base 5.3.1-1.
So it is somehow a combination of an arch compiled creator with an arch compiled qt5 version. If I have some spare time I will try the precompiled Qt Creator from qt-project.org and test it with the arch Qt builds to see if that makes any difference.
Edit:
I just checked with downloaded Qt Creator 3.1.2 form qt-project.org and I get no Debug output either so it definitley has something to do with the arch build environment as the build process is quiet straight forward I have absolutly no idea where this bug comes from.
1. Start Qt Creator from the command line with: QT_LOGGING_TO_CONSOLE=1 qtcreator
2. Export QT_LOGGING_TO_CONSOLE=1 to your environment (.bashrc/.zshrc/etc.)
3. Edit the qtcreator.desktop file to set the QT_LOGGING_TO_CONSOLE variable (This could be done by the maintainer of qtcreator in the arch repo so everyone will benefit)
4. Remove the journald line from the qt configure and recompile using abs and makepkg
5. Keep using the "old" workarounds e
I will add a request on the Qt bug tracker to set the QT_LOGGING_TO_CONSOLE variable internally by Qt Creator until than I hope everybody hit by this will find this bugreport, or the maintainer of Qt Creator will integrate the fix :P
Edit:
The upstream bug is https://bugreports.qt-project.org/browse/QTCREATORBUG-12564
I'd like if we keep logs in the journal; IMHO upstream is failing in providing reasons to avoid that.
do you think we can set "QT_LOGGING_TO_CONSOLE" in a wrapper script for Qt Creator binary or maybe just setting it in its .desktop file?
From what I understood upstream suggests to disable journald from Qt build, but that's because Qt Creator doesn't yet recognize if journald is enabled or not. I also understood that they will implement this in Qt Creator next release (maybe major one). What do you think?
In KDE, try calling krunner (Alt-F2), type «qtcreator».
The first alternative (default action) is to just launch /usr/bin/qtcreator, qtcreator.desktop is on the second place.
i try your step 1, 2, 3 but qDebug() still not work.
but, if i running in terminal it works.
im using qt creator 3.1.2 based on qt 5.3.1 gcc 4.9.0 64bit.
im using xfce4-terminal but in qtcreator - option - enviroment - system terminal is /usr/bin/xterm -e
i change it to /usr/bin xfce4-terminal -x
then, add QT_LOGGING_TO_CONSOLE=1
its work perfect now :)
Adding "QT_LOGGING_TO_CONSOLE=1" to /etc/enviroment solved it for me.