I'm trying to compile a qt project using terminal (Linux) qmake, but I'm getting the follwoing error message:
I tried to follow this manual: https://doc.qt.io/qt-5/qmake-manual.html

mainwindow.h
Qt Code:
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3.  
  4. #include <QMainWindow>
  5.  
  6. QT_BEGIN_NAMESPACE
  7. namespace Ui { class MainWindow; }
  8. QT_END_NAMESPACE
  9.  
  10. class MainWindow : public QMainWindow
  11. {
  12. Q_OBJECT
  13.  
  14. public:
  15. MainWindow(QWidget *parent = nullptr);
  16. ~MainWindow();
  17.  
  18. private:
  19. Ui::MainWindow *ui;
  20. };
  21. #endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode 

mainwindow.cpp
Qt Code:
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3.  
  4. MainWindow::MainWindow(QWidget *parent)
  5. : QMainWindow(parent)
  6. , ui(new Ui::MainWindow)
  7. {
  8. ui->setupUi(this);
  9. }
  10.  
  11. MainWindow::~MainWindow()
  12. {
  13. delete ui;
  14. }
To copy to clipboard, switch view to plain text mode 

main.cpp
Qt Code:
  1. #include "mainwindow.h"
  2.  
  3. #include <QApplication>
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. QApplication a(argc, argv);
  8. MainWindow w;
  9. w.show();
  10. return a.exec();
  11. }
To copy to clipboard, switch view to plain text mode 

main.pro
Qt Code:
  1. HEADERS += mainwindow.h
  2. SOURCES += mainwindow.cpp
  3. SOURCES += main.cpp
To copy to clipboard, switch view to plain text mode 

[rob@archrob qteste]$ qmake main.pro
[rob@archrob qteste]$ make
g++ -c -pipe -O2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o mainwindow.o mainwindow.cpp
In file included from mainwindow.cpp:1:
mainwindow.h:4:10: fatal error: QMainWindow: No such file or directory
4 | #include <QMainWindow>
| ^~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:663: mainwindow.o] Error 1