I delving into Qt4 GUI programming, but I can't compile this:
the error is:
but even when I explicitly give the include paths:
I get this:
I *know*, I could probably use qmake to build this, but the inquisitive part of me is jumping out; it's still just a C++ program, why can't I compile it?
Thanks for any nudges in the right direction.
Code:
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.resize(100, 30);
hello.show();
return app.exec();
}
the error is:
Code:
> gcc -o qt qt.cpp
qt.cpp:1:24: error: QApplication: No such file or directory
qt.cpp:2:23: error: QPushButton: No such file or directory
qt.cpp: In function 'int main(int, char**)':
[BLAH BLAH BLAH]
>
but even when I explicitly give the include paths:
Code:
//#include <QApplication>
#include "/usr/local/include/qt4/QtGui/QApplication"
//#include <QPushButton>
#include "/usr/local/include/qt4/QtGui/QPushButton"
I get this:
Code:
> gcc -o qt qt.cpp
In file included from /usr/local/include/qt4/QtGui/QApplication:1,
from qt.cpp:2:
/usr/local/include/qt4/QtGui/qapplication.h:45:37: error: QtCore/qcoreapplication.h: No such file or directory
/usr/local/include/qt4/QtGui/qapplication.h:46:31: error: QtGui/qwindowdefs.h: No such file or directory
/usr/local/include/qt4/QtGui/qapplication.h:47:27: error: QtCore/qpoint.h: No such file or directory
/usr/local/include/qt4/QtGui/qapplication.h:48:26: error: QtCore/qsize.h: No such file or directory
[CLIPPED THE REST, YOU GET THE POINT]
I *know*, I could probably use qmake to build this, but the inquisitive part of me is jumping out; it's still just a C++ program, why can't I compile it?
Thanks for any nudges in the right direction.