Getting started with problems
-
Hi all
Just started programming QT, but faced with some problems. Trying to create an empty project i got an error:
in my source file:
@#include <QtGui>int main(int argc, char** argv)
{
QApplication a(argc, argv);
return a.exec();
}
@
in my project file:
@QT += core guiTEMPLATE = app
SOURCES +=
main.cpp
CONFIG += qt warn_on
@
D:\Qt\Projects\EmptyOne\main.cpp:5: ошибка: variable 'QApplication a' has initializer but incomplete type
QApplication a(argc, argv);
whats wrong?
my book says that QtGui already included definitions of class QApplication... Qt 5.1 -
Hi,
Please refer to "Thread ":http://qt-project.org/forums/viewthread/18766 that tackles problem of includes and gives information about problems of including whole modules.
Best regards,
guziemic -
Your book is based on Qt4, but you are using Qt5. QApplication is no longer found in QtGui module, it now resides in QtWidgets.
-
[quote author="sierdzio" date="1379479065"]Your book is based on Qt4, but you are using Qt5. QApplication is no longer found in QtGui module, it now resides in QtWidgets.[/quote]
Oh thanks