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. Qt 5.0.1 build failure on linux with Gcc-4.8.0 and c++11 turned on.
Forum Updated to NodeBB v4.3 + New Features

Qt 5.0.1 build failure on linux with Gcc-4.8.0 and c++11 turned on.

Scheduled Pinned Locked Moved Installation and Deployment
4 Posts 3 Posters 4.3k Views 3 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.
  • S Offline
    S Offline
    suryakiran
    wrote on last edited by
    #1

    Hello,
    I'm trying to build Qt-5.0.1 on 64bit linux with GCC-4.8.0 enabling c++11. Compilation is failing with bunch of errors.

    kernel/qtimerinfo_unix.cpp:98:30: error: redeclaration ‘constexpr T qAbs(const T&) [with T = timeval]’ differs in ‘constexpr’
    timeval qAbs(const timeval &t)
    ^
    In file included from ../../include/QtCore/qglobal.h:1:0,
    from global/qt_pch.h:58:
    ../../include/QtCore/../../src/corelib/global/qglobal.h:483:27: error: from previous declaration ‘constexpr T qAbs(const T&) [with T = timeval]’
    Q_DECL_CONSTEXPR inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
    ^
    kernel/qtimerinfo_unix.cpp: In function ‘constexpr T qAbs(const T&) [with T = timeval]’:
    kernel/qtimerinfo_unix.cpp:109:1: error: body of constexpr function ‘constexpr T qAbs(const T&) [with T = timeval]’ not a return-statement
    }
    ^
    ... and so on

    Compilation is fine when c++11 is turned off. What am I missing here ?

    Thanks,
    Surya

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to DevNet,

      Have a look at this "thread":http://qt-project.org/forums/viewthread/26312/ it contains some indication about your problem

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • linamiL Offline
        linamiL Offline
        linami
        wrote on last edited by
        #3

        i'm compiling QT 5.0.2 on linux , how can help me with this error ?

        g++ -c -include .pch/release-shared/Qt5Core -m64 -pipe -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -O2 -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_NO_USING_NAMESPACE -DQT_BUILD_CORE_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 -DELF_INTERPRETER="/lib64/ld-linux-x86-64.so.2" -DQT_USE_ICU -DPCRE_HAVE_CONFIG_H -DHB_EXPORT=Q_CORE_EXPORT -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -I../../mkspecs/linux-g++-64 -I. -I../../include -I../../include/QtCore -I../../include/QtCore/5.0.2 -I../../include/QtCore/5.0.2/QtCore -Iglobal -I../3rdparty/pcre -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared -o .obj/release-shared/qtimerinfo_unix.o kernel/qtimerinfo_unix.cpp
        kernel/qtimerinfo_unix.cpp:98:30: error: redeclaration ‘constexpr T qAbs(const T&) [with T = timeval]’ differs in ‘constexpr’
        timeval qAbs(const timeval &t)
        ^
        In file included from ../../include/QtCore/qglobal.h:1:0,
        from global/qt_pch.h:58:
        ../../include/QtCore/../../src/corelib/global/qglobal.h:483:27: error: from previous declaration ‘constexpr T qAbs(const T&) [with T = timeval]’
        Q_DECL_CONSTEXPR inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
        ^
        kernel/qtimerinfo_unix.cpp: In function ‘constexpr T qAbs(const T&) [with T = timeval]’:
        kernel/qtimerinfo_unix.cpp:109:1: error: body of constexpr function ‘constexpr T qAbs(const T&) [with T = timeval]’ not a return-statement
        }
        ^
        In file included from ../../include/QtCore/qglobal.h:1:0,
        from global/qt_pch.h:58:
        ../../include/QtCore/../../src/corelib/global/qglobal.h: In instantiation of ‘constexpr T qAbs(const T&) [with T = timeval]’:
        kernel/qtimerinfo_unix.cpp:147:44: required from here
        ../../include/QtCore/../../src/corelib/global/qglobal.h:483:55: error: no match for ‘operator>=’ (operand types are ‘const timeval’ and ‘int’)
        Q_DECL_CONSTEXPR inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
        ^
        ../../include/QtCore/../../src/corelib/global/qglobal.h:483:55: note: candidates are:
        In file included from ../../include/QtCore/qpair.h:1:0,
        from ../../include/QtCore/../../src/corelib/tools/qmap.h:48,
        from ../../include/QtCore/qmap.h:1,
        from ../../include/QtCore/../../src/corelib/kernel/qvariant.h:49,
        from ../../include/QtCore/qvariant.h:1,
        from global/qt_pch.h:66:
        ../../include/QtCore/../../src/corelib/tools/qpair.h:98:24: note: template<class T1, class T2> bool operator>=(const QPair<T, U>&, const QPair<T, U>&)
        Q_INLINE_TEMPLATE bool operator>=(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
        ^
        ../../include/QtCore/../../src/corelib/tools/qpair.h:98:24: note: template argument deduction/substitution failed:
        In file included from ../../include/QtCore/qglobal.h:1:0,
        from global/qt_pch.h:58:
        ../../include/QtCore/../../src/corelib/global/qglobal.h:483:55: note: ‘const timeval’ is not derived from ‘const QPair<T, U>’
        Q_DECL_CONSTEXPR inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
        ^
        In file included from ../../include/QtCore/qstring.h:1:0,
        from ../../include/QtCore/../../src/corelib/kernel/qobject.h:48,
        from ../../include/QtCore/qobject.h:1,
        from ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:45,
        from ../../include/QtCore/qcoreapplication.h:1,
        from global/qt_pch.h:64:
        ../../include/QtCore/../../src/corelib/tools/qstring.h:1309:13: note: bool operator>=(const QStringRef&, const QStringRef&)
        inline bool operator>=(const QStringRef &s1, const QStringRef &s2)
        ^
        ../../include/QtCore/../../src/corelib/tools/qstring.h:1309:13: note: no known conversion for argument 1 from ‘const timeval’ to ‘const QStringRef&’
        ../../include/QtCore/../../src/corelib/tools/qstring.h:1038:32: note: bool operator>=(const char*, QLatin1String)
        inline QT_ASCII_CAST_WARN bool operator>=(const char s1, QLatin1String s2)
        ^
        ../../include/QtCore/../../src/corelib/tools/qstring.h:1038:32: note: no known conversion for argument 1 from ‘const timeval’ to ‘const char
        ’
        ../../include/QtCore/../../src/corelib/tools/qstring.h:984:13: note: bool operator>=(QLatin1String, QLatin1String)
        inline bool operator>=(QLatin1String s1, QLatin1String s2)
        ^
        ../../include/QtCore/../../src/corelib/tools/qstring.h:984:13: note: no known conversion for argument 1 from ‘const timeval’ to ‘QLatin1String’
        ../../include/QtCore/../../src/corelib/tools/qstring.h:1336:32: note: bool operator>=(const char*, const QStringRef&)
        inline QT_ASCII_CAST_WARN bool operator>=(const char s1, const QStringRef &s2)
        ^
        ../../include/QtCore/../../src/corelib/tools/qstring.h:1336:32: note: no known conversion for argument 1 from ‘const timeval’ to ‘const char
        ’
        ../../include/QtCore/../../src/corelib/tools/qstring.h:1025:32: note: bool operator>=(const char*, const QString&)
        inline QT_ASCII_CAST_WARN bool operator>=(const char s1, const QString &s2)
        ^
        ../../include/QtCore/../../src/corelib/tools/qstring.h:1025:32: note: no known conversion for argument 1 from ‘const timeval’ to ‘const char
        ’
        In file included from ../../include/QtCore/qbytearray.h:1:0,
        from ../../include/QtCore/../../src/corelib/tools/qstring.h:46,
        from ../../include/QtCore/qstring.h:1,
        from ../../include/QtCore/../../src/corelib/kernel/qobject.h:48,
        from ../../include/QtCore/qobject.h:1,
        from ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:45,
        from ../../include/QtCore/qcoreapplication.h:1,
        from global/qt_pch.h:64:
        ../../include/QtCore/../../src/corelib/tools/qbytearray.h:560:13: note: bool operator>=(const char*, const QByteArray&)
        inline bool operator>=(const char a1, const QByteArray &a2)
        ^
        ../../include/QtCore/../../src/corelib/tools/qbytearray.h:560:13: note: no known conversion for argument 1 from ‘const timeval’ to ‘const char
        ’
        ../../include/QtCore/../../src/corelib/tools/qbytearray.h:558:13: note: bool operator>=(const QByteArray&, const char*)
        inline bool operator>=(const QByteArray &a1, const char a2)
        ^
        ../../include/QtCore/../../src/corelib/tools/qbytearray.h:558:13: note: no known conversion for argument 1 from ‘const timeval’ to ‘const QByteArray&’
        ../../include/QtCore/../../src/corelib/tools/qbytearray.h:556:13: note: bool operator>=(const QByteArray&, const QByteArray&)
        inline bool operator>=(const QByteArray &a1, const QByteArray &a2)
        ^
        ../../include/QtCore/../../src/corelib/tools/qbytearray.h:556:13: note: no known conversion for argument 1 from ‘const timeval’ to ‘const QByteArray&’
        In file included from ../../include/QtCore/qchar.h:1:0,
        from ../../include/QtCore/../../src/corelib/tools/qstring.h:45,
        from ../../include/QtCore/qstring.h:1,
        from ../../include/QtCore/../../src/corelib/kernel/qobject.h:48,
        from ../../include/QtCore/qobject.h:1,
        from ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:45,
        from ../../include/QtCore/qcoreapplication.h:1,
        from global/qt_pch.h:64:
        ../../include/QtCore/../../src/corelib/tools/qchar.h:390:13: note: bool operator>=(QChar, QChar)
        inline bool operator>=(QChar c1, QChar c2) { return c1.unicode() >= c2.unicode(); }
        ^
        ../../include/QtCore/../../src/corelib/tools/qchar.h:390:13: note: no known conversion for argument 1 from ‘const timeval’ to ‘QChar’
        In file included from ../../include/QtCore/qglobal.h:1:0,
        from global/qt_pch.h:58:
        ../../include/QtCore/../../src/corelib/global/qglobal.h:483:66: error: no match for ‘operator-’ (operand type is ‘const timeval’)
        Q_DECL_CONSTEXPR inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
        ^
        ../../include/QtCore/../../src/corelib/global/qglobal.h:483:66: note: candidates are:
        In file included from ../../include/QtCore/5.0.2/QtCore/private/qcore_unix_p.h:1:0,
        from kernel/qtimerinfo_unix.cpp:45:
        ../../include/QtCore/5.0.2/QtCore/private/../../../../../src/corelib/kernel/qcore_unix_p.h:133:16: note: timeval operator-(const timeval&, const timeval&)
        inline timeval operator-(const timeval &t1, const timeval &t2)
        ^
        ../../include/QtCore/5.0.2/QtCore/private/../../../../../src/corelib/kernel/qcore_unix_p.h:133:16: note: candidate expects 2 arguments, 1 provided
        In file included from ../../include/QtCore/qsharedpointer_impl.h:1:0,
        from ../../include/QtCore/../../src/corelib/tools/qsharedpointer.h:50,
        from ../../include/QtCore/qsharedpointer.h:1,
        from ../../include/QtCore/../../src/corelib/kernel/qpointer.h:45,
        from ../../include/QtCore/qpointer.h:1,
        from ../../include/QtCore/5.0.2/QtCore/private/../../../../../src/corelib/kernel/qobject_p.h:57,
        from ../../include/QtCore/5.0.2/QtCore/private/qobject_p.h:1,
        from kernel/qtimerinfo_unix.cpp:47:
        ../../include/QtCore/../../src/corelib/tools/qsharedpointer_impl.h:697:63: note: template<class T, class X> typename QSharedPointer<T>::difference_type operator-(const QSharedPointer<T>&, const QSharedPointer<T>&)
        Q_INLINE_TEMPLATE typename QSharedPointer<T>::difference_type operator-(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2)
        ^
        ../../include/QtCore/../../src/corelib/tools/qsharedpointer_impl.h:697:63: note: template argument deduction/substitution failed:
        In file included from ../../include/QtCore/qglobal.h:1:0,
        from global/qt_pch.h:58:
        ../../include/QtCore/../../src/corelib/global/qglobal.h:483:66: note: ‘const timeval’ is not derived from ‘const QSharedPointer<T>’
        Q_DECL_CONSTEXPR inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
        ^
        In file included from ../../include/QtCore/qsharedpointer_impl.h:1:0,
        from ../../include/QtCore/../../src/corelib/tools/qsharedpointer.h:50,
        from ../../include/QtCore/qsharedpointer.h:1,
        from ../../include/QtCore/../../src/corelib/kernel/qpointer.h:45,
        from ../../include/QtCore/qpointer.h:1,
        from ../../include/QtCore/5.0.2/QtCore/private/../../../../../src/corelib/kernel/qobject_p.h:57,
        from ../../include/QtCore/5.0.2/QtCore/private/qobject_p.h:1,
        from kernel/qtimerinfo_unix.cpp:47:
        ../../include/QtCore/../../src/corelib/tools/qsharedpointer_impl.h:702:63: note: template<class T, class X> typename QSharedPointer<T>::difference_type operator-(const QSharedPointer<T>&, X
        )
        Q_INLINE_TEMPLATE typename QSharedPointer<T>::difference_type operator-(const QSharedPointer<T> &ptr1, X ptr2)
        ^
        ../../include/QtCore/../../src/corelib/tools/qsharedpointer_impl.h:702:63: note: template argument deduction/substitution failed:
        In file included from ../../include/QtCore/qglobal.h:1:0,
        from global/qt_pch.h:58:
        ../../include/QtCore/../../src/corelib/global/qglobal.h:483:66: note: ‘const timeval’ is not derived from ‘const QSharedPointer<T>’
        Q_DECL_CONSTEXPR inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
        ^
        In file included from ../../include/QtCore/qsharedpointer_impl.h:1:0,
        from ../../include/QtCore/../../src/corelib/tools/qsharedpointer.h:50,
        from ../../include/QtCore/qsharedpointer.h:1,
        from ../../include/QtCore/../../src/corelib/kernel/qpointer.h:45,
        from ../../include/QtCore/qpointer.h:1,
        from ../../include/QtCore/5.0.2/QtCore/private/../../../../../src/corelib/kernel/qobject_p.h:57,
        from ../../include/QtCore/5.0.2/QtCore/private/qobject_p.h:1,
        from kernel/qtimerinfo_unix.cpp:47:
        ../../include/QtCore/../../src/corelib/tools/qsharedpointer_impl.h:707:63: note: template<class T, class X> typename QSharedPointer<T>::difference_type operator-(T
        , const QSharedPointer<T>&)
        Q_INLINE_TEMPLATE typename QSharedPointer<X>::difference_type operator-(T ptr1, const QSharedPointer<X> &ptr2)
        ^
        ../../include/QtCore/../../src/corelib/tools/qsharedpointer_impl.h:707:63: note: template argument deduction/substitution failed:
        In file included from ../../include/QtCore/qglobal.h:1:0,
        from global/qt_pch.h:58:
        ../../include/QtCore/../../src/corelib/global/qglobal.h:483:66: note: mismatched types ‘T
        ’ and ‘timeval’
        Q_DECL_CONSTEXPR inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
        ^
        ../../include/QtCore/../../src/corelib/global/qglobal.h:483: confused by earlier errors, bailing out
        make: *** [.obj/release-shared/qtimerinfo_unix.o] Error 1

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          You posted almost the same question in several threads like this one or that one.

          So what exactly are you trying to do ? Build for Linux ? OpenWRT ? What distribution are you using ? What version of GCC ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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