I have been struggling with this error for more than two hours:
error: aggregate 'Ui::UpdaterProgress updaterProgress' has incomplete type and cannot be defined
I have a simple UI screen on Qt. Setting up with a dialog:
#include <ui_UpdaterProgress.h>
namespace Ui {
class UpdaterProgress;
}
....
Ui::UpdaterProgress updaterProgress;
QDialog updateProgressDialog;
updaterProgress.setupUi(&updateProgressDialog);
It’s a simple UI with an icon, two labels, progress bar and a cancel button. Am I doing anything wrong here?
I get this error if I don’t do the forward declaration:
error: 'UpdaterProgress' is not a member of 'Ui'
error: expected `;' before 'updaterProgress'
error: 'updaterProgress' was not declared in this scope
Have you defined class UpdaterProgress in your
....???Define your
UpdaterProgressclass before using it inUi::UpdaterProgress updaterProgress;.Prototyping itself cannot tell anything about the class, that’s why incomplete type error.