Results 1 to 4 of 4

Thread: cannot find QApplication [qt4]

  1. #1
    Join Date
    Mar 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default cannot find QApplication [qt4]

    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!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: cannot find QApplication [qt4]

    Do you have the libqt4-dev package installed?

  3. #3
    Join Date
    Mar 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: cannot find QApplication [qt4]

    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?

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: cannot find QApplication [qt4]

    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:
    Qt Code:
    1. // The system qmake (which is incomplete on your system)
    2. $ which qmake
    3. /usr/bin/qmake
    4. $ qmake -v
    5. QMake version 2.01a
    6. Using Qt version 4.7.4 in /usr/lib64/qt4
    7.  
    8. // Adjust the path to use the Qt SDK
    9. $ export PATH=/home/chrisw/QtSDK/Desktop/Qt/4.8.0/gcc/bin:$PATH
    10. $ which qmake
    11. /home/chrisw/QtSDK/Desktop/Qt/4.8.0/gcc/bin/qmake
    12. $ qmake -v
    13. QMake version 2.01a
    14. Using Qt version 4.8.0 in /home/chrisw/QtSDK/Desktop/Qt/4.8.0/gcc/lib
    To copy to clipboard, switch view to plain text mode 

  5. The following user says thank you to ChrisW67 for this useful post:

    ce-nest-pas-un-nom (15th March 2012)

Similar Threads

  1. Replies: 2
    Last Post: 1st August 2011, 07:30
  2. Qt without QApplication
    By jakebman in forum Newbie
    Replies: 6
    Last Post: 25th July 2008, 01:38
  3. subclassing QApplication
    By nupul in forum Newbie
    Replies: 2
    Last Post: 19th April 2006, 20:29
  4. why we have need of QApplication
    By Krishnacins in forum Qt Programming
    Replies: 11
    Last Post: 12th April 2006, 17:37
  5. <QtGui/QApplication> vs. <QApplication>
    By seneca in forum Qt Programming
    Replies: 5
    Last Post: 25th January 2006, 11:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.