Good day to all! I installed Ubuntu 16.04 LTS on my brand new laptop and decided to install Qt here. I downloaded, so I installed the installation file for Qt version 5.7 c of.site, installed in the folder opt / qtsdk /. All is well. I launch QtCreator, create a standard (window) application, build it, everything starts and works.
Then, if you do everything through the terminal and the qmake utility, the project is not going to and qmake swears at the alleged lack of header files, but again, everything works through QtCreator.
Here is the output of the error that qmake produces: I do this:
qmake -project qmake make Writes:
...... In file included from main.cpp:1:0: mainwindow.h:4:23: fatal error: QMainWindow: Нет такого файла или каталога compilation terminated. ..... What could be the problem?
In the PATH environment variable, I wrote the path to qmake:
sudo -s gedit /etc/profile PATH=/opt/qtsdk/5.7/gcc_64/bin:$PATH export PATH Here is the project structure:
main.cpp #include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); } mainwindow.h #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private: Ui::MainWindow *ui; }; #endif // MAINWINDOW_H mainwindow.cpp #include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; }