Good initializer but incomplete type error
-
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.
-
@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
) -
Thanks, guys. Do you mean use <QApplication> instead of <QtGui> or include both. Thanks again.
-
@SGaist said in Good initializer but incomplete type error:
Change #include <QtGui> by #include <QApplication>