Include <QtDebug> in QT 4.7.4



  • I am running the latest QT SDK. However, it seems I can no longer use the qtdebug function since include <QtDebug> library doesn't exist anymore in this new version. Do we still use this for debugging purposes or how do we make screen prints or cout type statements for debugging purposes in the latest QT?



  • @#include <QDebug>@



  • @#include <QDebug>@ works for me.



  • Still works for me, both in Qt 4.7.4 and 4.8.0 with
    @
    #include <QtDebug>
    @



  • What is your Nokia QT installation directory like? Using @#include <QtDebug>@ the QT Creator would tell me this library doesn't exist.



  • You have created a Qt project right? If you have created a plain c/c++ project the libraries may not be include-able :)


  • Moderators

    QtDebug and QDebug are on include/QtCore. Both are including qdebug.h.



  • [quote author="ddriver" date="1329939265"]You have created a Qt project right? If you have created a plain c/c++ project the libraries may not be include-able :)[/quote]

    Are you serious?! I am using the Plain C++ Project just to make it less convoluted when I'm trying to test the OpenCV codes. How would I make the qDebug library "include-able" in a Plain C++ Project??

    [quote author="koahnig" date="1329939628"]QtDebug and QDebug are on include/QtCore. Both are including qdebug.h.[/quote]

    My qdebug.h is all the way in here:
    C:\QtSDK\QtSources\4.8.0\include\QtCore

    But it's not picking it up from QT Creator.



  • Well, you have told Qt you don't want to use the Qt framework and still wonder why it cannot find a Qt library.

    Qt modules are not include-able in plain c++ project to me as well, autocomplete is not finding anything as well, as far as the IDE is concerned there are no Qt modules.

    Maybe there is a workaround for this like using absolute path for include... or if the experts know a way to override this?



  • [quote author="ddriver" date="1329940704"]Well, you have told Qt you don't want to use the Qt framework and still wonder why it cannot find a Qt library.

    Qt modules are not include-able in plain c++ project to me as well, autocomplete is not finding anything as well, as far as the IDE is concerned there are no Qt modules.

    Maybe there is a workaround for this like using absolute path for include... or if the experts know a way to override this?[/quote]

    I tried to add the path directly in and it doesn't work either

    @ INCLUDEPATH += C:\opencv\build\include
    C:\QtSDK\QtSources\4.8.0\include @



  • But it does work if you create a Qt project right?

    I can only point out the reason why it isn't working, hopefully someone more adept than me can elaborate how to include Qt libraries in a plain C++ project.


  • Moderators

    Well, my suggestion would be to setup the project as a Qt project and check the differences in the different settings of the .pro file. It does nto have to be the compelete setup, but the main skeleton. The comparison hopefully provides the hints.

    For one thing the discussion here concentrates on single lines, but the problem might be somewhere else.

    This engineering approach is not scientific, but it works most times ;-)



  • If you use QDebug, you need Qt libs too, otherwise you get a linker error, even if the compiler doesn't bail out prematurely. So it dosen't make sens at all to not create a Qt project.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.