Solved Compiling errors after loading old project
-
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.
-
I added the header but I received the same error:
-
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 Are those real build errors (so, when you build) or just errors from code model in QtCreator?
-
@jsulm They shows up when i build the project
-
@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. -
@JonB I don't know where the ui_*.h is located because it is now in the folder with project
-
@Dy3zz said in Compiling errors after loading old project:
I don't know where the ui_*.h is located
In the build folder
-
namespace Ui { class project: public Ui_project {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_PROJECTVIEW_H
This is the end of the ui_viewproject.h file
-
@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
-
@Dy3zz
Both @Christian and @Ehrlicher ? ;-)