i'd like to reuse this thread as i have a connected problem, but in Qt 4.2.0
my .pro starts like this:
TEMPLATE = app
QT += sql gui core qt3support
DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT
CONFIG += warn_off release qt app_bundle
TEMPLATE = app
QT += sql gui core qt3support
DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT
CONFIG += warn_off release qt app_bundle
To copy to clipboard, switch view to plain text mode
in my main.cpp i have:
#ifndef QT_NO_DEBUG_OUTPUT
DebugWindow* deb = DebugWindow::self();
qInstallMsgHandler(debugWinMsgHandler);
#endif
#ifndef QT_NO_DEBUG_OUTPUT
DebugWindow* deb = DebugWindow::self();
qInstallMsgHandler(debugWinMsgHandler);
#endif
To copy to clipboard, switch view to plain text mode
then i deleted everything in my build-directory and tried to rebuild my app (which had been compiling fine as a debugversion) and got building errors which lead me to qglobal.h. there i found this lines:
/*
Forward declarations only.
In order to use the qDebug() stream, you must #include<QDebug>
*/
class QDebug;
class QNoDebug;
#ifndef QT_NO_DEBUG_STREAM
Q_CORE_EXPORT_INLINE QDebug qDebug();
Q_CORE_EXPORT_INLINE QDebug qWarning();
Q_CORE_EXPORT_INLINE QDebug qCritical();
#else
inline QNoDebug qDebug();
#endif
/*
Forward declarations only.
In order to use the qDebug() stream, you must #include<QDebug>
*/
class QDebug;
class QNoDebug;
#ifndef QT_NO_DEBUG_STREAM
Q_CORE_EXPORT_INLINE QDebug qDebug();
Q_CORE_EXPORT_INLINE QDebug qWarning();
Q_CORE_EXPORT_INLINE QDebug qCritical();
#else
inline QNoDebug qDebug();
#endif
To copy to clipboard, switch view to plain text mode
i did change my DEFINES to
DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT QT_NO_DEBUG_STREAM
DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT QT_NO_DEBUG_STREAM
To copy to clipboard, switch view to plain text mode
but still i get
C:/Qt/4.2.0/include/QtCore/../../src/corelib/global/qglobal.h:1246: error: expected unqualified-id before "if"
C:/Qt/4.2.0/include/QtCore/../../src/corelib/global/qglobal.h:1246: error: expected `,' or `;' before "if"
C:/Qt/4.2.0/include/QtCore/../../src/corelib/global/qglobal.h:1246: error: expected unqualified-id before "else"
C:/Qt/4.2.0/include/QtCore/../../src/corelib/global/qglobal.h:1246: error: expected `,' or `;' before "else"
C:/Qt/4.2.0/include/QtCore/../../src/corelib/global/qglobal.h:1246: error: expected unqualified-id before "if"
C:/Qt/4.2.0/include/QtCore/../../src/corelib/global/qglobal.h:1246: error: expected `,' or `;' before "if"
C:/Qt/4.2.0/include/QtCore/../../src/corelib/global/qglobal.h:1246: error: expected unqualified-id before "else"
C:/Qt/4.2.0/include/QtCore/../../src/corelib/global/qglobal.h:1246: error: expected `,' or `;' before "else"
To copy to clipboard, switch view to plain text mode
line 1246 is the
inline QNoDebug qDebug();
inline QNoDebug qDebug();
To copy to clipboard, switch view to plain text mode
in the quote above. So what is the problem? the way i understand it they forward-declare classes QDebug and QNoDebug, and as i defined QT_NO_DEBUG_STREAM QNoDebug should be used whereve i call qDebug. Sounds fine to me
Bookmarks