I get the following error when I try to use qt5 for compiling - qt4 works fine. I always make sure to do make clean before make

Qt Code:
  1. g++ -Wl,-O1 -o raport main.o mainwindow.o qcgaugewidget.o qcustomplot.o qrc_res_file.o moc_mainwindow.o moc_qcgaugewidget.o moc_qcustomplot.o -lQt5OpenGL -L/usr/lib64 -lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Network -lQt5Sql -lQt5Xml -lQt5Core -lGL -lpthread
  2. moc_mainwindow.o:(.data.rel.ro._ZTV10MainWindow[_ZTV10MainWindow]+0x188): undefined reference to `QWidget::styleChange(QStyle&)'
  3. moc_mainwindow.o:(.data.rel.ro._ZTV10MainWindow[_ZTV10MainWindow]+0x190): undefined reference to `QWidget::enabledChange(bool)'
  4. moc_mainwindow.o:(.data.rel.ro._ZTV10MainWindow[_ZTV10MainWindow]+0x198): undefined reference to `QWidget::paletteChange(QPalette const&)'
  5. moc_mainwindow.o:(.data.rel.ro._ZTV10MainWindow[_ZTV10MainWindow]+0x1a0): undefined reference to `QWidget::fontChange(QFont const&)'
  6. moc_mainwindow.o:(.data.rel.ro._ZTV10MainWindow[_ZTV10MainWindow]+0x1a8): undefined reference to `QWidget::windowActivationChange(bool)'
  7. moc_mainwindow.o:(.data.rel.ro._ZTV10MainWindow[_ZTV10MainWindow]+0x1b0): undefined reference to `QWidget::languageChange()'
  8. moc_mainwindow.o:(.data.rel.ro._ZTV11ProgressBar[_ZTV11ProgressBar]+0x188): undefined reference to `QWidget::styleChange(QStyle&)'
  9. moc_mainwindow.o:(.data.rel.ro._ZTV11ProgressBar[_ZTV11ProgressBar]+0x190): undefined reference to `QWidget::enabledChange(bool)'
  10. moc_mainwindow.o:(.data.rel.ro._ZTV11ProgressBar[_ZTV11ProgressBar]+0x198): undefined reference to `QWidget::paletteChange(QPalette const&)'
  11. moc_mainwindow.o:(.data.rel.ro._ZTV11ProgressBar[_ZTV11ProgressBar]+0x1a0): undefined reference to `QWidget::fontChange(QFont const&)'
  12. moc_mainwindow.o:(.data.rel.ro._ZTV11ProgressBar[_ZTV11ProgressBar]+0x1a8): undefined reference to `QWidget::windowActivationChange(bool)'
  13. moc_mainwindow.o:(.data.rel.ro._ZTV11ProgressBar[_ZTV11ProgressBar]+0x1b0): undefined reference to `QWidget::languageChange()'
To copy to clipboard, switch view to plain text mode 

I have checked what other threads suggested
my .pro looks like this
Qt Code:
  1. # -------------------------------------------------
  2. # Project created by QtCreator 2009-12-02T13:24:40
  3. # -------------------------------------------------
  4. QT += network \
  5. opengl \
  6. sql \
  7. xml \
  8. gui
  9. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  10. greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport
  11.  
  12. TARGET = raport
  13. TEMPLATE = app
  14. SOURCES += main.cpp \
  15. mainwindow.cpp \
  16. qcgaugewidget.cpp \
  17. qcustomplot.cpp
  18. HEADERS += mainwindow.h \
  19. qcgaugewidget.h \
  20. qcustomplot.h
  21. FORMS += mainwindow.ui
  22. CONFIG += static
  23.  
  24. RESOURCES += \
  25. res_file.qrc
To copy to clipboard, switch view to plain text mode 

and all header files mentioned in .pro contain
#include <QWidget>