PDA

View Full Version : Compile and Run Qt programs in ubuntu 12.04



stbb24
25th May 2012, 02:54
How can I compile and run Qt programs in ubuntu 12.04??I tried using


g++ sample.cpp -o sample
sample.cpp:1:22: fatal error: qt4/QtGui: No such file or directory

but it gives an error

and I double check the installation files of Qt and everything is there

Any comments???

Zlatomir
30th May 2012, 09:09
First see the documentation (http://qt-project.org/doc/qt-4.8/gettingstartedqt.html) page, you need to run qmake -project first to generate project, then run qmake to generate makefile and then run make to build.

Anyway your current problem might be some issue with the path to Qt headers, but first try as described in the getting started page.

NathiyaAmose
7th August 2012, 13:43
Hi,
I am using qt-sdk(4.7) in ubuntu 12.04,when i open some programs in qtcreator my header files are marked with green lines and showing "QtGui no such file or directory" but i can compiile and run the program without error,please tell me how to rectify it.