Results 1 to 14 of 14

Thread: QApplication: no such file or directory

  1. #1
    Join Date
    Jan 2006
    Posts
    15
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default QApplication: no such file or directory

    Hi,

    I am working through a Qt tutrorial ( http://doc.trolltech.com/4.0/tutorial-t1.html ) and if I try to compile this source with "make" I get the error "QApplication: no such file or directory". Any idea what is wrong? (Okay the tutorial is for Qt4 and I have Qt3, but does it make a difference for a "Hello World" program?).

    I am using Linux, QTDIR is set to /usr/lib/qt3 and I have a file /usr/lib/qt3/include/qapplication.h.

    A second question in the same area: If I follow the Qt book ( http://doc.trolltech.com/4.0/how-to-learn-qt.html - see link in the first line of the text), they use #include <qapplication.h> which works on my computer. I thought one shouldn't use the <xxx.h> for includes anymore. Any opinion on that? Which tutorial is the more recent one?

    Regards,
    Jochen

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QApplication: no such file or directory

    I thought one shouldn't use the <xxx.h> for includes anymore.
    True for Qt 4.

    I believe you are still using Qt 3 which means you still need to use
    # include<xxxx.h>

  3. #3
    Join Date
    Jan 2006
    Location
    Athens - Greece
    Posts
    219
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QApplication: no such file or directory

    In general you can't compile Qt3 apps with Qt4 and Qt4 apps with Qt3. The first can only be accomplished by following the Porting to Qt4 guide.

  4. #4
    Join Date
    Jan 2006
    Location
    Bucureşti, RO
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QApplication: no such file or directory

    Quote Originally Posted by jochen_r
    Any idea what is wrong? (Okay the tutorial is for Qt4 and I have Qt3, but does it make a difference for a "Hello World" program?).
    Apparently there is a big difference even in a "Hello world" program .
    I mean I also tried to start learning Qt4.0 using the famous official Qt book, C++ GUI Programming with Qt 3 (ISBN 0-13-124072-2), but from the first program in the book (hello world) i received compilation errors. The book is still great because besides the program examples (which i am sure can be easily modified to work in 4.0 also) it gives you great explanation of all related Qt concepts (slots, signals, etc...).

    I am also a newbie to Qt and for now I sticked with the great Qt documentation (assistant) and so far so good. Actually not very far but still good )
    --
    In need of a fix called inocence ...

  5. #5
    Join Date
    Jan 2006
    Posts
    46
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: QApplication: no such file or directory

    I started by getting missing file errors and such like.

    If you are using Linux and these commands are available on your
    machine you can try:

    apt-cache search qt

    then, for all the stuff which sounds related to what you want, you do
    apt-get install <name of the application>

    You have to be root and to have write permission in /usr

    Mariane

    PS If you have a Debian Sarge you will still miss one file, with an
    unpronouncable name. I've forgotten which one it was, if you have a Debian
    Sarge I'll send you the file if you want. Just reming me of its name

  6. #6
    Join Date
    Jan 2006
    Location
    Lincoln, NE USA
    Posts
    177
    Thanks
    3
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QApplication: no such file or directory

    Quote Originally Posted by jochen_r
    Hi,

    I am working through a Qt tutrorial ( http://doc.trolltech.com/4.0/tutorial-t1.html ) and if I try to compile this source with "make" I get the error "QApplication: no such file or directory". Any idea what is wrong?
    I am coding using QT4, but I had something similar happen to me. I found out that it was because I didn't have
    Qt Code:
    1. CONFIG += qt
    To copy to clipboard, switch view to plain text mode 
    in my project file, hap2006.pro. That may not be your solution, but it worked for me.
    Quote Originally Posted by jochen_r
    A second question in the same area: If I follow the Qt book ( http://doc.trolltech.com/4.0/how-to-learn-qt.html - see link in the first line of the text), they use #include <qapplication.h> which works on my computer. I thought one shouldn't use the <xxx.h> for includes anymore. Any opinion on that? Which tutorial is the more recent one?

    Regards,
    Jochen
    I also ran into that TODAY!, while trying to edit and compile my hap2006 project in Code::Blocks with the MinGW compiler, as an experiment. I found out that some libraries required the ".h" extension, and some did not.

    For example, here are the #includes in my homestead.cpp file after I got it to compile using Code::Blocks and the MinGW compiler:
    Qt Code:
    1. #include <Qt>
    2. #include <QKeyEvent>
    3. #include <QString.h>
    4. #include <QStringList.h>
    5. #include <QMessageBox.h>
    6. #include <QDate>
    7. #include <QSqlQueryModel.h>
    8. #include <QSqlError.h>
    9. #include <QSqlRecord.h>
    10. #include <QSqlField.h>
    11. #include <QAbstractItemView.h>
    12. #include <QModelIndex>
    13. #include <QHeaderView>
    14. #include <QFile.h>
    15. #include <QDir.h>
    16. #include <QProcess.h>
    17. #include <QDialog.h>
    18. #include <QPrintDialog.h>
    19. #include <QPrinter.h>
    20. #include <QInputDialog.h>
    21. #include <math.h>
    22. #include <QValidator.h>
    23. #include <QIntValidator>
    24. #include <QPalette.h>
    25. #include <QTextEdit.h>
    26. #include <QTextDocument.h>
    To copy to clipboard, switch view to plain text mode 
    I just did trial and error on the include statements using the error msgs spit out by the compiler. "Qt" and "QDate" gave "can't find..." messages IF I added the ".h" extension. The rest failed if I DIDN'T have the ".h" extension.

  7. The following user says thank you to GreyGeek for this useful post:

    visionaire (18th April 2007)

  8. #7
    Join Date
    Jan 2006
    Location
    Athens - Greece
    Posts
    219
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QApplication: no such file or directory

    I remember that in Code::Blocks the included dirs paths were wrong when using the provided qt template (but I can't quite remember which version). If you created your makefile with qmake then the above mixup won't happen (qmake always knows what to include ).

  9. #8
    Join Date
    Apr 2007
    Posts
    1
    Thanks
    1

    Default Re: QApplication: no such file or directory

    the CONFIG += qt worked for me, thanks a lot!

  10. #9
    Join Date
    May 2007
    Posts
    131
    Thanks
    17
    Thanked 4 Times in 2 Posts

    Default Re: QApplication: no such file or directory

    For anyone else with this problem...

    I'm running Ubuntu (Kubuntu), and had to switch from 'qmake' to 'qmake-qt4' - it seems the default in Ubuntu is Qt3's qmake.

    Hope this helps someone.

  11. #10
    Join Date
    Jun 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QApplication: no such file or directory

    Quote Originally Posted by bmn View Post
    For anyone else with this problem...

    I'm running Ubuntu (Kubuntu), and had to switch from 'qmake' to 'qmake-qt4' - it seems the default in Ubuntu is Qt3's qmake.

    Hope this helps someone.
    yepp it indeed helped me

    thanx!

  12. #11
    Join Date
    Jul 2008
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QApplication: no such file or directory

    me too, I was looking for the answer for quite a while, thank you


    actually though, typing 'qmake-qt4' solves it for me on linux, and now I'm looking for the answer for the same problem on windows 2000. Seems logical the same problem will need a similar answer but the windows 2000 command line rejects all but 'qmake' so I don't know... maybe it's...
    Last edited by rjburk; 25th July 2008 at 08:30. Reason: updated contents

  13. #12
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QApplication: no such file or directory

    You just have to make sure that you execute the qmake of according Qt installation. In case you have multiple Qt installations, you either use the Qt Command Prompt of the according installation or you modify PATH environment by hand and add path to Qt 4's qmake as first path (or at least before Qt 3's path). Alternatively you can pass a full path to the qmake executable when launching it but that's not very convenient, of course.
    J-P Nurmi

  14. #13
    Join Date
    Jul 2008
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QApplication: no such file or directory

    ok sorry.. er.. My windows 2000 machine uses 'mingw32-make' to create the .exe files to be found in the 'release' or 'debug' folder

  15. #14
    Join Date
    Nov 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QApplication: no such file or directory

    Quote Originally Posted by rjburk View Post
    me too, I was looking for the answer for quite a while, thank you


    actually though, typing 'qmake-qt4' solves it for me on linux, and now I'm looking for the answer for the same problem on windows 2000. Seems logical the same problem will need a similar answer but the windows 2000 command line rejects all but 'qmake' so I don't know... maybe it's...

    "qmake-qt4" works for me. Thanks a lot!

Similar Threads

  1. QApplication: No such file or directory
    By panos in forum Newbie
    Replies: 10
    Last Post: 27th August 2007, 12:08
  2. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 16:21
  3. QApplication: No such file or directory
    By Dolinski in forum Newbie
    Replies: 4
    Last Post: 24th May 2007, 06:13
  4. errors while installing Qt4.2 in Linux
    By nimmyj in forum Installation and Deployment
    Replies: 11
    Last Post: 13th December 2006, 12:58
  5. Am I the only one with "make" error ?
    By probine in forum Installation and Deployment
    Replies: 1
    Last Post: 13th February 2006, 13:54

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.