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

virt-specifiers in ‘nativeEventFilter’ not allowed outside a class definition # define Q_DECL_OVERRIDE override



  • While compiling an example provided in Genlogic 3.7 the above mentioned error is displayed. I have already compiled this program in centos with Qt 5.9.1 but in ubuntu 16.04.05 this error appears.



  • I solved the problem. Actually this is the linker error. Some required libraries were missing, so I added them as per the Readme document of the GLG toolkit(for C++).
    I installed the compatible GLG program and in .pro file of Qt program the library path was properly included as :
    INCLUDEPATH += . /opt/glg3.7/include #comment (this line includes the header files)
    LIBS = -L/opt/glg3.7/lib -lglg_x11 -lglg_map_stub
    -lXt -lX11 -ljpeg -lpng -lz -ldl -lXft -lfontconfig -lfreetype #comment (-L includes the library folder and -l include the libraries itself)



  • @prashant.qt.developer
    The full error is mentioned below
    In file included from ../../../Qt5.9.1/5.9.1/gcc_64/include/QtCore/qglobal.h:98:0,
    from ../../../Qt5.9.1/5.9.1/gcc_64/include/QtGui/qtguiglobal.h:43,
    from ../../../Qt5.9.1/5.9.1/gcc_64/include/QtWidgets/qtwidgetsglobal.h:43,
    from ../../../Qt5.9.1/5.9.1/gcc_64/include/QtWidgets/qapplication.h:43,
    from ../../../Qt5.9.1/5.9.1/gcc_64/include/QtWidgets/QApplication:1,
    from ../qt_5x_glg/QGlgApplication.h:2,
    from ../qt_5x_glg/QGlgApplication.cpp:2:
    ../../../Qt5.9.1/5.9.1/gcc_64/include/QtCore/qcompilerdetection.h:1140:26: error: virt-specifiers in ‘nativeEventFilter’ not allowed outside a class definition

    define Q_DECL_OVERRIDE override

                          ^

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What does QGlgApplication.h contain ?
    What compiler are you using ?



  • I solved the problem. Actually this is the linker error. Some required libraries were missing, so I added them as per the Readme document of the GLG toolkit(for C++).
    I installed the compatible GLG program and in .pro file of Qt program the library path was properly included as :
    INCLUDEPATH += . /opt/glg3.7/include #comment (this line includes the header files)
    LIBS = -L/opt/glg3.7/lib -lglg_x11 -lglg_map_stub
    -lXt -lX11 -ljpeg -lpng -lz -ldl -lXft -lfontconfig -lfreetype #comment (-L includes the library folder and -l include the libraries itself)


Log in to reply