Results 1 to 4 of 4

Thread: QT_NO_DEBUG_OUTPUT cause compile errors!

  1. #1
    Join Date
    Dec 2007
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy QT_NO_DEBUG_OUTPUT cause compile errors!

    Hi! i have a problem with my application.

    if i compile with 'release' config, the qDebug messagess are showed on linux snderr... so, if i insert QT_NO_DEBUG_OUTPUT i have compiling errors:
    g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG_OUTPUT -DQT_NO_WARNING_OUTPUT -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/qt4/mkspecs/linux-g++ -I. -I/opt/qt4/include/QtCore -I/opt/qt4/include/QtCore -I/opt/qt4/include/QtNetwork -I/opt/qt4/include/QtNetwork -I/opt/qt4/include/QtGui -I/opt/qt4/include/QtGui -I/opt/qt4/include/QtXml -I/opt/qt4/include/QtXml -I/opt/qt4/include -I. -Isrc -Isrc/ui -Ibuild/moc -Ibuild/ui -o build/obj/Authenticator.o src/Authenticator.cpp
    /opt/qt4/include/QtCore/qdebug.h:113: error: expected unqualified-id before ‘if’
    /opt/qt4/include/QtCore/qdebug.h:113: error: expected unqualified-id before ‘else’
    /opt/qt4/include/QtCore/qglobal.h: In member function ‘void Authenticator::authMySelf()’:
    /opt/qt4/include/QtCore/qglobal.h:1257: error: too few arguments to function ‘void qWarning(const char*, ...)’
    src/Authenticator.cpp:67: error: at this point in file
    src/Authenticator.cpp: In member function ‘bool Authenticator::isConnected()’:
    src/Authenticator.cpp:295: error: expected primary-expression before ‘if’
    src/Authenticator.cpp:295: error: expected `:' before ‘if’
    src/Authenticator.cpp:295: error: expected primary-expression before ‘if’
    src/Authenticator.cpp:295: error: expected `;' before ‘if’
    src/Authenticator.cpp:295: error: expected primary-expression before ‘else’
    src/Authenticator.cpp:295: error: expected `;' before ‘else’
    src/Authenticator.cpp:295: error: expected primary-expression before ‘else’
    src/Authenticator.cpp:295: error: expected `;' before ‘else’
    src/Authenticator.cpp:331: error: expected primary-expression before ‘if’
    src/Authenticator.cpp:331: error: expected `:' before ‘if’
    src/Authenticator.cpp:331: error: expected primary-expression before ‘if’
    src/Authenticator.cpp:331: error: expected `;' before ‘if’
    src/Authenticator.cpp:331: error: expected primary-expression before ‘else’
    src/Authenticator.cpp:331: error: expected `;' before ‘else’
    src/Authenticator.cpp:331: error: expected primary-expression before ‘else’
    src/Authenticator.cpp:331: error: expected `;' before ‘else’
    make: *** [build/obj/Authenticator.o] Error 1
    my .pro file is this:
    Qt Code:
    1. TEMPLATE = app
    2. TARGET = qrm3wifi
    3. DEPENDPATH += . src ui
    4. INCLUDEPATH += . src src/ui
    5. HEADERS += src/Authenticator.h \
    6. src/Qrm3Controller.h \
    7. src/SettingsExpert.h \
    8. .......................................
    9. src/AliveCommand.h \
    10. src/SettingsGlobalResource.h
    11. FORMS += ui/mainGui.ui
    12. SOURCES += src/Authenticator.cpp \
    13. src/Qrm3Controller.cpp \
    14. src/SettingsExpert.cpp \
    15. ..............................................
    16. src/AliveCommand.cpp
    17. QT += network xml
    18. DESTDIR = bin
    19. MOC_DIR = build/moc
    20. RCC_DIR = build/rcc
    21. UI_DIR = build/ui
    22. OBJECTS_DIR = build/obj
    23. RESOURCES = resources/qrm3wifi.qrc
    24. CONFIG += release
    25. DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT
    To copy to clipboard, switch view to plain text mode 

    the chunk of code is here:

    Qt Code:
    1. qWarning() << "Server response with a non 200 Http state.";
    To copy to clipboard, switch view to plain text mode 

    and
    Qt Code:
    1. (isConnectedHost1)? qDebug() << "Reachable" : qDebug() << "NOT Reachable";
    2.  
    3. /**
    4.  * Check if yahoo italy is reachable
    5.  */
    6. if (!socket2.waitForConnected(CONN_TIMEOUT))
    7. ......
    To copy to clipboard, switch view to plain text mode 

    please, help me!
    Last edited by jacek; 7th January 2008 at 20:28. Reason: changed [code] to [quote]

  2. #2
    Join Date
    Jan 2007
    Posts
    92
    Thanks
    14
    Thanked 1 Time in 1 Post

    Default Re: QT_NO_DEBUG_OUTPUT cause compile errors!

    Try declaring NDEBUG to turn off debugging instead of DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT.

    Qt Code:
    1. debug {
    2. DEFINES += DEBUG
    3. }
    4. else //Release mode
    5. {
    6. DEFINES += NDEBUG
    7. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Dec 2007
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT_NO_DEBUG_OUTPUT cause compile errors!

    um no.. it doesn't works!

    i have try release and DEFINES += NDEBUG and the compile is ok, but the debug messasgess are showed
    Last edited by slux; 7th January 2008 at 23:40.

  4. #4
    Join Date
    Dec 2007
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Red face Re: QT_NO_DEBUG_OUTPUT cause compile errors!


Similar Threads

  1. Compile Errors
    By luffy27 in forum Qt Programming
    Replies: 3
    Last Post: 4th November 2006, 05:26
  2. Qt compilation errors
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 31st October 2006, 17:29
  3. Qt Compile Errors?
    By magikalpnoi in forum Qt Programming
    Replies: 4
    Last Post: 14th September 2006, 22:18
  4. Project won't compile under Windows (works under Linux)
    By philski in forum Qt Programming
    Replies: 7
    Last Post: 14th September 2006, 15:29
  5. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 19:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.