Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [SOLVED] Error when using qmake to install another program : #include <Qapplication>
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Error when using qmake to install another program : #include <Qapplication>

Scheduled Pinned Locked Moved Installation and Deployment
5 Posts 3 Posters 4.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    YoGsimus
    wrote on 31 May 2014, 17:37 last edited by
    #1

    I am trying to install a Keepassx and to do so I need to use qmake. When I do that it works without a hitch but when i execute the next step which is 'make', i get the following error.

    keepassx.h:43:24: fatal error: QApplication: No such file or directory
    #include <QApplication>

    Please keep in mind I am quite new to Linux and even newer to QT.
    Also I have on my system version QTcreator 5.3.0

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 31 May 2014, 19:30 last edited by
      #2

      Hi and welcome to devnet,

      I suspect that Keepassx was written for Qt 4, if so you are missing the

      @QT += widgets@

      line in the pro file.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        YoGsimus
        wrote on 31 May 2014, 20:10 last edited by
        #3

        Ok so i added QT += widgets to the pro file and now I am recieving a new error:

        In file included from keepassx.h:80:0:
        lib/UrlLabel.h:28:85: error: ‘Qt::WFlags’ has not been declared
        LinkLabel(QWidget *parent,const QString& text=QString::null, int x=0, int y=0,Qt::WFlags f=0);

        just to be sure I am adding to the correct file, i added the QT += widgets to the src.pro file within the keepassx directory. Is that correct or am i supposed to be changing a pro file within QT itself?

        Thankyou

        I found in the forums that QT::WFlags should be changed to WindowFlags which i did and am now recieving this error:

        lib/UrlLabel.h:28:87: error: ‘QT’ has not been declared
        LinkLabel(QWidget *parent,const QString& text=QString::null, int x=0, int y=0,QT::WindowFlags f=0);
        ^
        lib/UrlLabel.h:28:103: error: expected ‘,’ or ‘...’ before ‘f’
        LinkLabel(QWidget parent,const QString& text=QString::null, int x=0, int y=0,QT::WindowFlags f=0);
        ^
        lib/UrlLabel.h:28:9: error: default argument missing for parameter 5 of ‘LinkLabel::LinkLabel(QWidget
        , const QString&, int, int, int)’
        LinkLabel(QWidget *parent,const QString& text=QString::null, int x=0, int y=0,QT::WindowFlags f=0);
        ^

        1 Reply Last reply
        0
        • J Offline
          J Offline
          JKSH
          Moderators
          wrote on 31 May 2014, 22:59 last edited by
          #4

          Hi,

          [quote author="YoGsimus" date="1401567021"]just to be sure I am adding to the correct file, i added the QT += widgets to the src.pro file within the keepassx directory. Is that correct or am i supposed to be changing a pro file within QT itself?[/quote]That file is correct.

          By the way, it's "Qt", not "QT". "QT" stands for Apple QuickTime.

          [quote author="YoGsimus" date="1401567021"]
          lib/UrlLabel.h:28:87: error: ‘QT’ has not been declared
          LinkLabel(QWidget *parent,const QString& text=QString::null, int x=0, int y=0,QT::WindowFlags f=0);[/quote]C++ is case-sensitive. You need to write "Qt::WindowFlags", not "QT::WindowFlags".

          Note: KeePassX was written with Qt 4, but you're trying to build with Qt 5. That's why you are getting error messages. You have two options:

          Use Qt 4. If you are on Ubuntu, there are instructions at https://www.keepassx.org/dev/projects/keepassx/wiki/Install_instructions

          Port the application to Qt 5. Refer to the "porting guide":http://qt-project.org/doc/qt-5/sourcebreaks.html when error messages appear.

          I think Option #1 is easier.

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • Y Offline
            Y Offline
            YoGsimus
            wrote on 1 Jun 2014, 00:04 last edited by
            #5

            Ah thankyou very much for your help Qt 4 was the solution!

            1 Reply Last reply
            0

            1/5

            31 May 2014, 17:37

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved