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. Makefile doesnot work
Forum Updated to NodeBB v4.3 + New Features

Makefile doesnot work

Scheduled Pinned Locked Moved Installation and Deployment
9 Posts 4 Posters 5.8k 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.
  • M Offline
    M Offline
    manish411
    wrote on last edited by
    #1

    I installed qt through tarball.
    qt1.cpp in qt folder

    [code]
    #include <qapplication.h>
    #include <qlabel.h>
    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    QLabel *label = new QLabel("Hello Qt!", 0);
    app.setMainWidget(label);
    label->show();
    return app.exec();
    }
    [/code]

    while making the executable file
    [code]
    utkarsh@utkarsh-laptop:~/programming/qt$ qmake qt.pro
    utkarsh@utkarsh-laptop:~/programming/qt$ make
    g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o q1.o q1.cpp
    q1.cpp:1: fatal error: qapplication.h: No such file or directory
    compilation terminated.
    make: *** [q1.o] Error 1
    utkarsh@utkarsh-laptop:~/programming/qt$
    [/code]

    I am following the book - C++ gui programming with QT3 by Jasmin Blanchette
    I instlled QT 4.4.3 tarball

    1 Reply Last reply
    0
    • P Offline
      P Offline
      pacanek
      wrote on last edited by
      #2

      @#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();
      }@

      Try with this. Qt4 is not Qt3 also it's Qt(cute) not QT ;-)

      1 Reply Last reply
      0
      • M Offline
        M Offline
        manish411
        wrote on last edited by
        #3

        thnx for your support
        after making the above changes I m
        getting the following results

        [code]
        utkarsh@utkarsh-laptop:~/programming/qt$ qmake qt.pro
        utkarsh@utkarsh-laptop:~/programming/qt$ make
        g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o q1.o q1.cpp
        q1.cpp:1: fatal error: QApplication: No such file or directory
        compilation terminated.
        make: *** [q1.o] Error 1
        [/code]

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Chris H
          wrote on last edited by
          #4

          Can you take a look at the contents of /usr/include/qt4/QtGui/ and verify that QApplication is in there?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            manish411
            wrote on last edited by
            #5

            There is no such qt4 directory in /usr/include
            Does that mean that QT4 is not installed properly?
            what I did was unzipped the tar archive into /usr/local
            ./configure
            make
            and set the appropriate path

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Chris H
              wrote on last edited by
              #6

              Right, you didn't install Qt where it is looking for it. When you say "set the appropriate path" what exactly did you do? In general when installing software on Linux (I assume this is something along those lines), you would:
              @./configure --prefix=/path/where/you/want/it
              make
              make install@
              I'm not sure how Qt's installation scheme differs from the norm, but you might try that.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                manish411
                wrote on last edited by
                #7

                I followed all the instruction given in the install manual
                ftp://ftp.trolltech.com/qt/source/INSTALL
                I set the path as

                $export PATH=/usr/local/Trolltech/Qt-4.3.3/bin:$PATH

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  Chris H
                  wrote on last edited by
                  #8

                  OK, PATH isn't your issue here, that's just telling your system where the binaries are. But it looks to me like Qt is installed in "/usr/local/Trolltech/Qt-4.3.3/" and not "/usr/" : so you need to change your project file to look in the right place.

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    goetz
                    wrote on last edited by
                    #9

                    Please note that Qt 4.3.3 is very outdated. Current release is 4.8.0 from yesterday.

                    http://www.catb.org/~esr/faqs/smart-questions.html

                    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