Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

error: 'QtInfoMsg' was not declared in this scope



  • Dear all,
    I try to use another Qt version (Note1) to test my project again. This time I have another problem (Note2). But It's ok for qt-opensource-linux-x64-5.6.0.run, qt-opensource-linux-x64-5.6.2 and qt-opensource-linux-x64-5.7.0
    Could you give me some suggestions? Thanks a lot.
    I have already tried to google some information. Until now,I could not find the solution.

    Note1:

    1. use apt-get install qt5-default qtcreator -y
      => qt-creator verision:2.8.84 based on Qt5.2.0
      2.g++ version : g++-4.8 (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)

    Note2:
    g++ -c -m64 -pipe -g -Wall -W -D_REENTRANT -fPIE -DDEBUG_MODE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I../SMPCodeReader1 -I../bardecoder_8_1_1/include -I/home/ubuntu/bardecoder_8_1_1/include/harfbuzz -I/usr/include -I../SMPCodeReader1/src/uEye/amd64 -I/usr/include/qt5 -I/usr/include/qt5/QtMultimedia -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I. -I. -I. -o main.o ../SMPCodeReader1/main.cpp
    ../SMPCodeReader1/main.cpp: In function 'void myMessageOutput(QtMsgType, const QMessageLogContext&, const QString&)':
    ../SMPCodeReader1/main.cpp:18:14: error: 'QtInfoMsg' was not declared in this scope
    case QtInfoMsg:
    ^
    make: *** [main.o] Error 1



  • @SGaist HI,thanks. I think it's my problem of working environment. Now it's fixed. Thanks.


  • Lifetime Qt Champion

    Hi,

    QtInfoMessage was added in Qt 5.5. See here.



  • @SGaist HI,thanks. I think it's my problem of working environment. Now it's fixed. Thanks.


Log in to reply