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

Qt5 mod doesn't look in the default /usr/include include path

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.0.2
    • Build tools: moc
    • None

    Description

      I built qtbase and installed it into /usr. Then I checked out qtsvg as a stand alone module (needed by the unusual build system I was using) and ran /usr/bin/qmake in it. When I compiled qtsvg I got an error from the moc:

      /usr/bin/moc -DQT_NO_USING_NAMESPACE -DQT_BUILD_SVG_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/mkspecs/linux-g++-64 -I. -I../../include -I../../include/QtSvg -I../../include/QtSvg/5.0.2 -I../../include/QtSvg/5.0.2/QtSvg -I/usr/include/QtWidgets -I/usr/include/QtWidgets/5.0.2 -I/usr/include/QtWidgets/5.0.2/QtWidgets -I/usr/include/QtGui -I/usr/include/QtGui/5.0.2 -I/usr/include/QtGui/5.0.2/QtGui -I/usr/include/QtCore -I/usr/include/QtCore/5.0.2 -I/usr/include/QtCore/5.0.2/QtCore -I.moc/release-shared qgraphicssvgitem.h -o .moc/release-shared/moc_qgraphicssvgitem.cpp
      qgraphicssvgitem.h:63: Error: Undefined interface
      make[2]: *** [.moc/release-shared/moc_qgraphicssvgitem.cpp] Error 1
      make[2]: Leaving directory `/qtsvg.build/src/svg'
      make[1]: *** [sub-svg-make_first-ordered] Error 2
      make[1]: Leaving directory `/qtsvg.build/src'
      make: *** [sub-src-make_first] Error 2

      There is no '-I/usr/include' path in the moc command and so this include isn't found by the moc:

      #include <QtWidgets/qgraphicsitem.h>

      Which means this macro in qgraphicsitem.h isn't found, and hence the moc error about an undefined interface:

      Q_DECLARE_INTERFACE(QGraphicsItem, "org.qt-project.Qt.QGraphicsItem")

      The include paths in the qmake generated Makefiles work fine with the c++ compiler as it looks in /usr/include by default, whereas the moc doesn't.

      Attachments

        Issue Links

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

          Activity

            People

              ogoffart Olivier Goffart (Woboq GmbH)
              rdale Richard Dale
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes