Hi,
did you use qmake to set up a project file as described in the same tutorial?
If not run "qmake -project" followed "qmake" and then "make" in the directory your project is in. This should work without setting up any path to the header files.
Else if the project doesn't work try to tell the compiler explicit where it finds the headers by appending
-I/usr/local/Trolltech/Qt-4.2.2/include/QtCore -I/usr/local/Trolltech/Qt-4.2.2/include/QtGui -I/usr/local/Trolltech/Qt-4.2.2/mkspecs/linux-g++ -I/usr/local/Trolltech/Qt-4.2.2/include
to your g++ calls. When you link everything together you also need to specify which libraries to use for this. Append
-L/usr/local/Trolltech/Qt-4.2.2/lib -lQtGui -lQtCore
Now it should compile and link without errors.
If you get linker errors when you start the application you need to set the path to the Qt libraries in the LD_LIBRARY_PATH environment variable.
You can also add the above includes to the CPLUS_INCLUDE_PATH variable. Btw. the PATH variable should only contain paths to binaries. The compiler doesn't look there for anything.
Hope it helps.
Bookmarks