Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-28824

qmake -project doesn't add necessary modules

    XMLWordPrintable

Details

    Description

      For simple projects it used to be possible to build direct from source like this

      qmake -project
      qmake -makefile
      make
      

      In Qt5 this got broken and its now necessary to had edit the .pro files after the first step.

      Using the Nokia hello world QT example (attached), the following occurs:

      jeremy@blackbox ~/src/qt_bugs/qmake-qt-var $ ~/src/qt-everywhere-opensource-src-5.0.0/qtbase/bin/qmake -project
      jeremy@blackbox ~/src/qt_bugs/qmake-qt-var $ ~/src/qt-everywhere-opensource-src-5.0.0/qtbase/bin/qmake -makefile
      jeremy@blackbox ~/src/qt_bugs/qmake-qt-var $ make
      g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I../../qt-everywhere-opensource-src-5.0.0/qtbase/mkspecs/linux-g++-64 -I. -I. -I../../qt-everywhere-opensource-src-5.0.0/qtbase/include -I../../qt-everywhere-opensource-src-5.0.0/qtbase/include/QtGui -I../../qt-everywhere-opensource-src-5.0.0/qtbase/include/QtCore -I. -o main.o main.cpp
      main.cpp:1:24: fatal error: QApplication: No such file or directory
      compilation terminated.
      make: *** [main.o] Error 1
      

      I can build code by hand editing the .pro file after qmake created it and adding a line

      QT += widgets
      

      However this is a regression. If qmake -makefile now needs that line for even the most simple cases, qmake -project should write it in.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            sonander Jeremy Sonander
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes