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

Wrong include paths passed to moc

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.1.0 RC1
    • 5.1.0 Beta 1
    • Packaging & Installer
    • None
    • Debian Wheezy; binary offline installer qt-linux-opensource-5.1.0-beta1-x86-offline.run; gcc-4.6
    • da05ebd96250e5c90ca6b6df52bcce52d4f264ce

    Description

      Hello,
      I tried to compile a little project with Qt5.1beta1.
      (I am on a Debian Wheezy with the binary offline installer qt-linux-opensource-5.1.0-beta1-x86-offline.run)

      This produced following error (see command line [1], from the compile window of qtcreator):

      usr/include/c++/4.6/bits/stl_relops.:68: Parse error at "std"
      

      When trying to look deeper on what is happening it seems that the macro _GLIBCXX_VISIBILITY on the std namespace is undefined [2].
      Looking even deeper with strace reveals, that moc tries to open a header file c++config.h which would define the missing macro. [3]
      The error is solved when adding/changing the include path which leads to c++config.h

      changing

        -I/usr/include/c++/4.6/i686-linux-gnu/.
                                ^
      

      to

        -I/usr/include/c++/4.6/i486-linux-gnu/.
                                ^
      

      This problem is probably debian specific because of the directory structure where the headers are placed.
      The directory with i686 does not even exist on my system, only one with i486.
      Therefore this is probably defined at compile time of the Qt release, which happened at a system which has the files in i686.

      For gcc this is no problem because he knows where to find his headers.
      So probably moc or qmake could be a little smarter about it by finding out what include paths to use from gcc like in [4].

      Kind regards,
      Bernhard

      [1]
      bernhard@debian:/data/yammi/2013-05-09/git.code.sf.net/yammi-git/src$ /data/yammi/2013-05-29_qt5/qt/5.1.0-beta1/gcc/bin/moc -DUSE_QMEDIAPLAYER -DUSE_TAGLIB -DUSE_XINE -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/mkspecs/linux-g++ -I. -I/usr/include/taglib -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/include -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/include/QtMultimedia -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/include/QtWidgets -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/include/QtXml -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/include/QtNetwork -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/include/QtGui -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/include/QtCore -I.moc -I.ui -I/usr/include/c++/4.6 -I/usr/include/c++/4.6/i686-linux-gnu/. -I/usr/include/c++/4.6/backward -I/usr/lib/gcc/i686-linux-gnu/4.6.1/include -I/usr/local/include -I/usr/lib/gcc/i686-linux-gnu/4.6.1/include-fixed -I/usr/include/i386-linux-gnu -I/usr/include applytoalldialog.h -o .moc/moc_applytoalldialog.cpp
      usr/include/c++/4.6/bits/stl_relops.:68: Parse error at "std"
      
      
      [2]
      bernhard@debian:/data/yammi/2013-05-09/git.code.sf.net/yammi-git/src$ /data/yammi/2013-05-29_qt5/qt/5.1.0-beta1/gcc/bin/moc -E -DUSE_QMEDIAPLAYER -DUSE_TAGLIB -DUSE_XINE -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/mkspecs/linux-g++ -I. -I/usr/include/taglib -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/include -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/include/QtMultimedia -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/include/QtWidgets -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/include/QtXml -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/include/QtNetwork -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/include/QtGui -I../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/include/QtCore -I.moc -I.ui -I/usr/include/c++/4.6 -I/usr/include/c++/4.6/i686-linux-gnu/. -I/usr/include/c++/4.6/backward -I/usr/lib/gcc/i686-linux-gnu/4.6.1/include -I/usr/local/include -I/usr/lib/gcc/i686-linux-gnu/4.6.1/include-fixed -I/usr/include/i386-linux-gnu -I/usr/include applytoalldialog.h -o /dev/stdout | grep -v -E "^$" | head
            
      namespace std _GLIBCXX_VISIBILITY(default)
      {
      namespace rel_ops
      {
      _GLIBCXX_BEGIN_NAMESPACE_VERSION 
      template <class _Tp>
      inline bool
      operator!=(const _Tp& __x, const _Tp& __y)
      { return !(__x == __y); } 
      
      
      [3]
      bernhard@debian:/data/yammi/2013-05-09/git.code.sf.net/yammi-git/src$ strace -f [command from above] 2>&1 | grep -i -E "^open|c\+\+config" --color=always
      ...
      open("applytoalldialog.h", O_RDONLY)    = 3
      open("/data/yammi/2013-05-09/git.code.sf.net/yammi-git/src/.ui/ui_ApplyToAllBase.h", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 4
      ...
      open("/usr/include/c++/4.6/algorithm", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 4
      open("/usr/include/c++/4.6/utility", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 4
      stat64("../../../../2013-05-29_qt5/qt/5.1.0-beta1/gcc/mkspecs/linux-g++/bits/c++config.h", 0xbfa48328) = -1 ENOENT (No such file or directory)
      stat64("./bits/c++config.h", 0xbfa48328) = -1 ENOENT (No such file or directory)
      stat64("/usr/include/taglib/bits/c++config.h", 0xbfa48328) = -1 ENOENT (No such file or directory)
      ...
      stat64("/usr/include/c++/4.6/bits/c++config.h", 0xbfa48328) = -1 ENOENT (No such file or directory)
      stat64("/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h", 0xbfa48328) = -1 ENOENT (No such file or directory)
      stat64("/usr/include/c++/4.6/backward/bits/c++config.h", 0xbfa48328) = -1 ENOENT (No such file or directory)
      ...
      open("/usr/include/c++/4.6/bits/stl_relops.h", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 4
      ...
      
      
      [4]
      bernhard@debian:/data/yammi/2013-05-09/git.code.sf.net/yammi-git/src$ g++-4.6 -print-prog-name=cc1plus
      /usr/lib/gcc/i486-linux-gnu/4.6/cc1plus
      bernhard@debian:/data/yammi/2013-05-09/git.code.sf.net/yammi-git/src$ /usr/lib/gcc/i486-linux-gnu/4.6/cc1plus -v not-existing
      ignoring nonexistent directory "/usr/lib/gcc/i486-linux-gnu/4.6/../../../../i486-linux-gnu/include"
      #include "..." search starts here:
      #include <...> search starts here:
       /usr/include/c++/4.6
       /usr/include/c++/4.6/i486-linux-gnu
       /usr/include/c++/4.6/backward
       /usr/lib/gcc/i486-linux-gnu/4.6/include
       /usr/local/include
       /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed
       /usr/include
      End of search list.
      ...
      
      

      (paths modified to get below the size limitations of the forum, first posted in the forums http://qt-project.org/forums/viewthread/28316/ )

      Attachments

        Issue Links

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

          Activity

            People

              seahumad [BB] Sergio Ahumada (Inactive)
              bernhardue Bernhard
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes