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. Something about include file
Qt 6.11 is out! See what's new in the release blog

Something about include file

Scheduled Pinned Locked Moved Installation and Deployment
4 Posts 2 Posters 1.6k 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.
  • qazaq408Q Offline
    qazaq408Q Offline
    qazaq408
    wrote on last edited by
    #1

    yesterday I download and install QT-5.3 on my linux(ubuntukylin),today I try to compile my first QT-project.
    I write the code by VIM like like this :
    @#include<QApplication>
    #include<QLabel>
    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    QLabel *label = new QLabel("Hello Qt!");
    label->show();
    return app.exec();
    }@
    I save this file when I finished , and the file's path is /home/jxf/TestQt
    then commond:
    cd /home/jxf/TestQt
    qmake -project
    qmake TestQt.pro

    so far,everything is going well
    when I used last commond : make
    the system tell me,"fatal error: QApplication: No such file or directory",

    then I try to find answer in inter,and someone tell me put "QT += widgets" in TestQt.pro.

    I do like this and compile again,but system tell me "fatal error: Qlabel: No such file or directory" this time,

    others in inernet tell me modify source code file,
    #include<QtWidgets/QLabel> replace #include<QLabel>,
    but when I make ,system still tell me fatal error: Qlabel: No such file or directory

    How can I do....

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      Could you show TestQt.pro ?
      Did you run qmake to regenerate Makefile after you have changed TestQt.pro?

      1 Reply Last reply
      0
      • qazaq408Q Offline
        qazaq408Q Offline
        qazaq408
        wrote on last edited by
        #3

        [quote author="andreyc" date="1402808566"]Could you show TestQt.pro ?
        Did you run qmake to regenerate Makefile after you have changed TestQt.pro?[/quote]
        Could you show TestQt.pro ?
        ls -l /home/jxf/testQt
        qt.cxx
        testQt.pro
        Makefile

        vim /home/jxf/testQt/testQt.pro

        TEMPLATE = app
        TARGET = testQt
        INCLUDEPATHPATH +=.
        #Input
        SOURCES +=qt.cxx
        QT += widgets

        Did you run qmake to regenerate Makefile after you have changed TestQt.pro?
        if I hadn't input "QT += widgets",system will tell me " fatal error: QApplication: No such file or directory" when I using commond "make".
        if I had input like source file,system will tell me "fatal error: Qlabel: No such file or directory".

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andreyc
          wrote on last edited by
          #4

          I copied your files and it run without any errors.

          Is it possible that you have another version of Qt installed?
          Qt-4 that comes with Ubuntu for example.

          Try to run qmake from Qt-5.3 using full path.
          Something like this
          @
          $HOME/Qt/5.3/gcc_64/bin/qmake
          @

          1 Reply Last reply
          0

          • Login

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