Compile errors updating my OSX and Qt



  • Hi All, i'm update my MAC OSX from version 10.9 to 10.10.5, and Qt from 5.4 to 5.5
    Now compiling my qt project I get a lot of errors:

    16:58:00: Starting: "/usr/bin/make" 
    /Users/MyUser/Qt/5.5/clang_64/bin/uic ../myproject/mainwindow.ui -o ui_mainwindow.h
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -std=c++0x -pthread -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.7 -Wall -W -fPIC -D__MACOSX__ -D__P_THREAD__ -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../myproject -I. -I../../includes -I../myproject/common -I../myproject/imagecommand -I../myproject/server -I/Users/MyUser/Qt/5.5/clang_64/lib/QtWidgets.framework/Headers -I/Users/MyUser/Qt/5.5/clang_64/lib/QtGui.framework/Headers -I/Users/MyUser/Qt/5.5/clang_64/lib/QtNetwork.framework/Headers -I/Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I/Users/MyUser/Qt/5.5/clang_64/mkspecs/macx-clang -F/Users/MyUser/Qt/5.5/clang_64/lib -o main.o ../myproject/main.cpp
    In file included from ../myproject/main.cpp:1:
    In file included from ../myproject/mainwindow.h:4:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtWidgets.framework/Headers/QMainWindow:1:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtWidgets.framework/Headers/qmainwindow.h:37:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtWidgets.framework/Headers/qwidget.h:38:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qobject.h:41:
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:739:55: error: no type named 'u16string' in namespace 'std'
        static inline QString fromStdU16String(const std::u16string &s);
                                                     ~~~~~^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:740:17: error: no type named 'u16string' in namespace 'std'
        inline std::u16string toStdU16String() const;
               ~~~~~^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:741:55: error: no type named 'u32string' in namespace 'std'
        static inline QString fromStdU32String(const std::u32string &s);
                                                     ~~~~~^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:742:17: error: no type named 'u32string' in namespace 'std'
        inline std::u32string toStdU32String() const;
               ~~~~~^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1307:53: error: no type named 'u16string' in namespace 'std'
    inline QString QString::fromStdU16String(const std::u16string &s)
                                                   ~~~~~^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1310:13: error: no type named 'u16string' in namespace 'std'
    inline std::u16string QString::toStdU16String() const
           ~~~~~^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1311:15: error: no member named 'u16string' in namespace 'std'
    { return std::u16string(reinterpret_cast<const char16_t*>(utf16()), length()); }
             ~~~~~^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1313:53: error: no type named 'u32string' in namespace 'std'
    inline QString QString::fromStdU32String(const std::u32string &s)
                                                   ~~~~~^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1316:13: error: no type named 'u32string' in namespace 'std'
    inline std::u32string QString::toStdU32String() const
           ~~~~~^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1318:19: error: expected ';' after expression
        std::u32string u32str(length(), char32_t(0));
                      ^
                      ;
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1318:10: error: no member named 'u32string' in namespace 'std'
        std::u32string u32str(length(), char32_t(0));
        ~~~~~^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1318:20: error: use of undeclared identifier 'u32str'
        std::u32string u32str(length(), char32_t(0));
                       ^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1319:75: error: use of undeclared identifier 'u32str'
        int len = toUcs4_helper(d->data(), length(), reinterpret_cast<uint*>(&u32str[0]));
                                                                              ^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1320:5: error: use of undeclared identifier 'u32str'
        u32str.resize(len);
        ^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1321:12: error: use of undeclared identifier 'u32str'
        return u32str;
               ^
    In file included from ../myproject/main.cpp:1:
    In file included from ../myproject/mainwindow.h:4:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtWidgets.framework/Headers/QMainWindow:1:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtWidgets.framework/Headers/qmainwindow.h:37:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtWidgets.framework/Headers/qwidget.h:41:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtGui.framework/Headers/qpalette.h:39:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtGui.framework/Headers/qbrush.h:37:
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qpair.h:62:44: error: no member named 'declval' in namespace 'std'
            Q_DECL_NOEXCEPT_EXPR(noexcept(std::declval<T1&>() = p.first) && noexcept(std::declval<T2&>() = p.second))
                                          ~~~~~^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qcompilerdetection.h:1027:43: note: expanded from macro 'Q_DECL_NOEXCEPT_EXPR'
    # define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
                                              ^
    In file included from ../myproject/main.cpp:1:
    In file included from ../myproject/mainwindow.h:4:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtWidgets.framework/Headers/QMainWindow:1:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtWidgets.framework/Headers/qmainwindow.h:37:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtWidgets.framework/Headers/qwidget.h:41:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtGui.framework/Headers/qpalette.h:39:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtGui.framework/Headers/qbrush.h:37:
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qpair.h:62:52: error: 'T1' does not refer to a value
            Q_DECL_NOEXCEPT_EXPR(noexcept(std::declval<T1&>() = p.first) && noexcept(std::declval<T2&>() = p.second))
                                                       ^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qcompilerdetection.h:1027:43: note: expanded from macro 'Q_DECL_NOEXCEPT_EXPR'
    # define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
                                              ^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qpair.h:42:17: note: declared here
    template <class T1, class T2>
                    ^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qpair.h:62:55: error: expected expression
            Q_DECL_NOEXCEPT_EXPR(noexcept(std::declval<T1&>() = p.first) && noexcept(std::declval<T2&>() = p.second))
                                                          ^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qcompilerdetection.h:1027:43: note: expanded from macro 'Q_DECL_NOEXCEPT_EXPR'
    # define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
                                              ^
    In file included from ../myproject/main.cpp:1:
    In file included from ../myproject/mainwindow.h:4:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtWidgets.framework/Headers/QMainWindow:1:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtWidgets.framework/Headers/qmainwindow.h:37:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtWidgets.framework/Headers/qwidget.h:41:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtGui.framework/Headers/qpalette.h:39:
    In file included from /Users/MyUser/Qt/5.5/clang_64/lib/QtGui.framework/Headers/qbrush.h:37:
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qpair.h:62:57: error: expected expression
            Q_DECL_NOEXCEPT_EXPR(noexcept(std::declval<T1&>() = p.first) && noexcept(std::declval<T2&>() = p.second))
                                                            ^
    /Users/MyUser/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qcompilerdetection.h:1027:43: note: expanded from macro 'Q_DECL_NOEXCEPT_EXPR'
    # define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
                                              ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    make: *** [main.o] Error 1
    16:58:01: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project myproject (kit: Desktop Qt 5.5.1 clang 64bit)
    When executing step "Make"
    16:58:01: Elapsed time: 00:02.
    

    Help me please!
    Thanks


  • Lifetime Qt Champion

    Hi,

    Do you have CONFIG += c++11 in your .pro file ?



  • @SGaist nope

    My .pro file:

    QT       += core gui network widgets
    TARGET = myproject
    TEMPLATE = app
    CONFIG   -= app_bundle
    DESTDIR     =    /Users/myuser/Desktop/root/current/bin_osx
    
    INCLUDEPATH += common imagecommand server
    SUBDIRS     += common imagecommand server
    
    QMAKE_CXXFLAGS += -std=c++0x -pthread
    

  • Lifetime Qt Champion

    The correct way to activate C++11 in your .pro file is to use CONFIG += c++11 that will take care for you of the various platform differences i.e. in your case you should also change the -stdlib parameter which would be OS X specific.



  • Thanks SGaist, it's works adding c++11!
    You have saved my day.

    What do you mean exactly with "change the -stdlib parameter"?


  • Lifetime Qt Champion

    You're welcome !

    Change it to -stdlib=libc++

    Since you have it working now, please mark the thread as solved using the "Topic Tool" button so that other forum users may know a solution has been found :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.