Good initializer but incomplete type error
-
wrote on 14 Mar 2018, 21:18 last edited by
Does anyone see a problem with this code, because I do not. Thanks.
#include <QtGui>
int main(int argv, char **args)
{
QApplication app(args, argv);return app.exec();
}
-
Hi and welcome to devnet,
Change:
#include <QtGui>
by#include <QApplication>
In any case, if you are using Qt 5, QApplication is in the QtWidget module.
-
Does anyone see a problem with this code, because I do not. Thanks.
#include <QtGui>
int main(int argv, char **args)
{
QApplication app(args, argv);return app.exec();
}
@TMahoney1979 said in Good initializer but incomplete type error:
Does anyone see a problem with this code, because I do not. Thanks.
...
int main(int argv, char **args)
{
QApplication app(args, argv);@SGaist has identified the main problem.
However, the code you wrote won't compile either, because
argv
andargs
are the wrong way round in your QApplication constructor. (Moreover, they are conventionallyint argc
andchar **argv
) -
Hi and welcome to devnet,
Change:
#include <QtGui>
by#include <QApplication>
In any case, if you are using Qt 5, QApplication is in the QtWidget module.
wrote on 19 Mar 2018, 20:29 last edited byThanks, guys. Do you mean use <QApplication> instead of <QtGui> or include both. Thanks again.
-
wrote on 19 Mar 2018, 20:30 last edited by
@SGaist said in Good initializer but incomplete type error:
Change #include <QtGui> by #include <QApplication>
5/5