Compiling errors after loading old project
-
I reinstalled my virtual machine and tried to load my Qt project. But the problem is that i receive some errors that i didnt have before.
I let a scressshot of the errors below:This is the .cpp file. The header is the next:
#ifndef PROJECTVIEW_H #define PROJECTVIEW_H #include <QWidget> namespace Ui { class projectview; } class projectview : public QWidget { Q_OBJECT public: explicit projectview(QWidget *parent = nullptr); ~projectview(); private: Ui::projectview *ui; };
#endif // PROJECTVIEW_H
-
@Dy3zz said in Compiling errors after loading old project:
is there anything i can do about it?
Either rename your form in the designer or use the correct ui class name in your class.
-
You don't include the header (ui_projectview.h I would guess) where the class Ui::projectview is defined.
-
@Dy3zz said in Compiling errors after loading old project:
But the problem is that i receive some errors that i didnt have before.
As @Christian-Ehrlicher says, and you would have had same problem whenever you last saved this file as you show above.
-
Then look into the header and see if the class name is correct.
-
@Christian-Ehrlicher I put the header code in the initial question. It seems to be good for me
-
@Dy3zz
The question is not what you have inprojectview.h
but what you have (near the end of) the generatedui_projectview.h
file.What you are supposed to see there is:
namespace Ui { class projectView: public Ui_projectView {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_PROJECTVIEW_H
You will get the errors you are seeing if that is not the case.
If it does have that (or if it does not!), start by deleting all files in your build output directory, re-run
qmake
, rebuild all from scratch. You may have some "stale" files around. -
@Dy3zz said in Compiling errors after loading old project:
I don't know where the ui_*.h is located
In the build folder
-
@Dy3zz
You should follow the previously-suggested action:@JonB said in Compiling errors after loading old project:
If it does have that (or if it does not!), start by deleting all files in your build output directory, re-run qmake, rebuild all from scratch. You may have some "stale" files around.
EDIT
Actually, stop. You showclass project: public Ui_project {};
That is not right, I said it should read
projectView
. Compare what you have against what I said should be there. I would suggest at some time you renamed theproject
/projectView
class.... -
@JonB said in Compiling errors after loading old project:
That is not right, I said it should read projectView. Compare what you have against what I said should be there. I would suggest at some time you renamed the project/projectView class....
Yes.. is there anything i can do about it?
-
@Dy3zz said in Compiling errors after loading old project:
is there anything i can do about it?
Either rename your form in the designer or use the correct ui class name in your class.
-
@Christian-Ehrlicher it works. Thanks both of you for your time