Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Compile errors updating my OSX and Qt

    Installation and Deployment
    2
    6
    2274
    Loading More Posts
    • 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.
    • X
      xalisonx last edited by

      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

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by SGaist

        Hi,

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

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

        X 1 Reply Last reply Reply Quote 0
        • X
          xalisonx @SGaist last edited by

          @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
          
          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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.

            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 Reply Quote 1
            • X
              xalisonx last edited by

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

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

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 :)

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

                M 1 Reply Last reply Reply Quote 0
                • First post
                  Last post