PDA

View Full Version : cannot find QApplication [qt4]



ce-nest-pas-un-nom
13th March 2012, 18:11
I recently tried installing qt on Ubuntu. I'm trying to run a Hello World app.

qmake -project and qmake ran correctly, but when running make, I found it was looking for QApplication in /usr/include/qt4/*. I looked, and there is no qt4 under /usr/include.

Is there another place I should be looking for these files? Has anyone else had this problem?

Thank you very much!

ChrisW67
13th March 2012, 21:40
Do you have the libqt4-dev package installed?

ce-nest-pas-un-nom
14th March 2012, 13:53
I ran the .run file from the QT download page; I assumed that that would install the appropriate packages. Is that correct?

If not, is there a list of packages I need to apt-get or is libqt4-dev sufficient?

ChrisW67
14th March 2012, 23:02
The .run file should download a complete installation of Qt and rely on the system for a compiler. You need to make sure that you use the qmake from that installation in preference to the one already on your system. If you build using the Qt Creator from the SDK then this is probably taken care of, as long as you don't use "Qt from PATH" in your project build settings. To use it from the command line put the bin directory in your PATH:


// The system qmake (which is incomplete on your system)
$ which qmake
/usr/bin/qmake
$ qmake -v
QMake version 2.01a
Using Qt version 4.7.4 in /usr/lib64/qt4

// Adjust the path to use the Qt SDK
$ export PATH=/home/chrisw/QtSDK/Desktop/Qt/4.8.0/gcc/bin:$PATH
$ which qmake
/home/chrisw/QtSDK/Desktop/Qt/4.8.0/gcc/bin/qmake
$ qmake -v
QMake version 2.01a
Using Qt version 4.8.0 in /home/chrisw/QtSDK/Desktop/Qt/4.8.0/gcc/lib