Hey,
im just starting to learn about Qt so i bought the book "C++ GUI PROGRAMMING WITH Qt 4" and followed all the instructions as far as installing Qt 4.1.1 and everything went through fine, or so i thought. When i went to the first example things kinda went wrong...
typing qmake -project and qmake hello.pro to create a Makefile for a hello.cpp file went fine as well, but when i type make i get:
hello.cpp:1:24: error: QApplication: No such file or directory
hello.cpp:2:18: error: QLabel: No such file or directory
as well several other errors because those files could not found.
the code im trying to compile is:
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
label->show();
return app.exec();
}
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
i am also pretty sure that i have qt4 in my path, i added the lines:
PATH=/usr/local/Trolltech/Qt-4.1.1/bin:$PATH
export PATH
to my .profile file in my home dir.
if anyone has any ideas as to what could be wrong please let me know, the book said that if i get an error like this its most likely because im using an older version qt, and that i should make sure that i am indeed using qt4, this seems kind of silly to me as i installed qt4.1.1 that came on a cd with the book...
thanks in advance.
Bookmarks