fatal error: ui_mainwindow.h: No such file or directory #include "ui_mainwindow.h"
-
wrote on 8 Jan 2021, 13:15 last edited by
I've rebuild several times, run qmake etc. It doesnt solve .
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QtWidgets/QMainWindow> #include <QMainWindow> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { ui->setupUi(this); // Initialize the new objects myThreadObject = new MyThread(); myQThread = new QThread(); // Move to new thread myThreadObject->moveToThread(myQThread); // connect signal and slots connect(this, &MainWindow::startWriting, myThreadObject, &MyThread::writeData); connect(myThreadObject, &MyThread::writingDone, this, &MainWindow::writingDoneByThread); // Start the new thread myQThread->start(); }
-
I've rebuild several times, run qmake etc. It doesnt solve .
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QtWidgets/QMainWindow> #include <QMainWindow> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { ui->setupUi(this); // Initialize the new objects myThreadObject = new MyThread(); myQThread = new QThread(); // Move to new thread myThreadObject->moveToThread(myQThread); // connect signal and slots connect(this, &MainWindow::startWriting, myThreadObject, &MyThread::writeData); connect(myThreadObject, &MyThread::writingDone, this, &MainWindow::writingDoneByThread); // Start the new thread myQThread->start(); }
wrote on 8 Jan 2021, 13:19 last edited by JonB 1 Aug 2021, 13:31@suslucoder
Please don't delete an existing thread and then raise a new thread with the same question.What files do you have in your build/compile output directory? That is where it should be. Are you designing a
mainwindow.ui
from Qt Designer? -
@suslucoder
Please don't delete an existing thread and then raise a new thread with the same question.What files do you have in your build/compile output directory? That is where it should be. Are you designing a
mainwindow.ui
from Qt Designer?wrote on 8 Jan 2021, 13:33 last edited by@JonB I'm trying to do that; reading datas from txt in a thread, and write datas to txt in another thread. I have these:
-
@JonB I'm trying to do that; reading datas from txt in a thread, and write datas to txt in another thread. I have these:
wrote on 8 Jan 2021, 13:35 last edited by JonB 1 Aug 2021, 13:36@suslucoder said in fatal error: ui_mainwindow.h: No such file or directory #include "ui_mainwindow.h":
I'm trying to do that; reading datas from txt in a thread, and write datas to txt in another thread.
Sorry, but that has no relevance at all to a compilation problem.
[That's a completely separate matter from: given the questions you ask, if I were you I would not dream of doing anything involving threads...]
And is the missing file not in the
debug
directory? Assuming you're compiling for Debug, which you don't say. -
@suslucoder said in fatal error: ui_mainwindow.h: No such file or directory #include "ui_mainwindow.h":
I'm trying to do that; reading datas from txt in a thread, and write datas to txt in another thread.
Sorry, but that has no relevance at all to a compilation problem.
[That's a completely separate matter from: given the questions you ask, if I were you I would not dream of doing anything involving threads...]
And is the missing file not in the
debug
directory? Assuming you're compiling for Debug, which you don't say.wrote on 8 Jan 2021, 13:36 last edited by@JonB I have been solve it.
-
@JonB I have been solve it.
wrote on 8 Jan 2021, 13:37 last edited by@suslucoder
And how did you achieve the solution, given that you've asked so much about this? -
@suslucoder
And how did you achieve the solution, given that you've asked so much about this?wrote on 8 Jan 2021, 13:43 last edited by@JonB I copied "ui_mainwindow.h" file from another build file
-
@suslucoder
And how did you achieve the solution, given that you've asked so much about this?wrote on 8 Jan 2021, 13:45 last edited by@JonB said
given that you've asked so much about this?
Why do you always make insinuation to me? I dont know lots of the things about Qt and im trying to learn.
-
@JonB said
given that you've asked so much about this?
Why do you always make insinuation to me? I dont know lots of the things about Qt and im trying to learn.
wrote on 8 Jan 2021, 13:49 last edited by JonB 1 Aug 2021, 13:53@suslucoder
I'm sorry if you feel I'm being hard on you. Quite a few of your questions are things you really should be able to solve for yourself, not ask questions of other people. It may not seem like it, but in the long run reading documentation and solving things for yourself is the only way to learn. I will leave it at that now.BTW,
I copied "ui_mainwindow.h" file from another build file
This may or may not be right, depending on just what you did where. The
ui_mainwindow.h
has to be regenerated every time you edit in Designer to change themainwindow.ui
file. If you later find that you make changes in Designer and these are not reflected in your code, you will have hit a problem. Just saying.
1/9