qt5.6.0在Mac平台编译10.7版本的软件出错


In file included from /Users/imyfone/Qt5.5.0/5.5/clang_64/lib/QtGui.framework/Headers/QColor:1:

In file included from /Users/imyfone/Qt5.5.0/5.5/clang_64/lib/QtGui.framework/Headers/qcolor.h:39:

In file included from /Users/imyfone/Qt5.5.0/5.5/clang_64/lib/QtCore.framework/Headers/qstringlist.h:34:

In file included from /Users/imyfone/Qt5.5.0/5.5/clang_64/lib/QtCore.framework/Headers/qlist.h:1026:

In file included from /Users/imyfone/Qt5.5.0/5.5/clang_64/lib/QtCore.framework/Headers/qstringlist.h:40:

In file included from /Users/imyfone/Qt5.5.0/5.5/clang_64/lib/QtCore.framework/Headers/qregexp.h:41:

/Users/imyfone/Qt5.5.0/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/imyfone/Qt5.5.0/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/imyfone/Qt5.5.0/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/imyfone/Qt5.5.0/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/imyfone/Qt5.5.0/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1053:17: error: exception specification in declaration does not match previous declaration

inline QString::~QString() { if (!d->ref.deref()) Data::deallocate(d); }

^

/Users/imyfone/Qt5.5.0/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:219:12: note: previous declaration is here

inline ~QString();

^

/Users/imyfone/Qt5.5.0/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1081:28: error: calling a private constructor of class 'QCharRef'

{ Q_ASSERT(i >= 0); return QCharRef(*this, i); }

^

/Users/imyfone/Qt5.5.0/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:960:12: note: implicitly declared private here

inline QCharRef(QString &str, int idx)

^

/Users/imyfone/Qt5.5.0/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1083:10: error: calling a private constructor of class 'QCharRef'

{ return QCharRef(*this, i); }

^

/Users/imyfone/Qt5.5.0/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:960:12: note: implicitly declared private here

inline QCharRef(QString &str, int idx)

^

/Users/imyfone/Qt5.5.0/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/imyfone/Qt5.5.0/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/imyfone/Qt5.5.0/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(utf16()), length()); }

~~~~~^

/Users/imyfone/Qt5.5.0/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/imyfone/Qt5.5.0/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/imyfone/Qt5.5.0/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/imyfone/Qt5.5.0/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(&u32str[0]));

^

/Users/imyfone/Qt5.5.0/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1320:5: error: use of undeclared identifier 'u32str'

u32str.resize(len);

^

/Users/imyfone/Qt5.5.0/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:1321:12: error: use of undeclared identifier 'u32str'

return u32str;






#QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
macx: {
    message($$QMAKE_MACOSX_DEPLOYMENT_TARGET)
    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
    message($$QMAKE_MACOSX_DEPLOYMENT_TARGET)
}

QMAKE_MAC_SDK = macosx10.7
message($$QMAKE_MAC_SDK)
#/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -std=c++11 -O2 -isysroot
#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.9
QMAKE_CXXFLAGS += -std=c++11
#QMAKE_CXXFLAGS += -stdlib=libstdc++
QMAKE_CXXFLAGS += -stdlib=libc++   #添加这句语就不会出错了
http://stackoverflow.com/questions/32441022/compile-error-no-type-named-stdu16string-when-compiling-cclang-project-f


你可能感兴趣的:(qt,for,Mac)