I am using QT 5.5.0.
When I compile the program, it shows “no type named“ u16string ”in the“ std ”namespace. The interesting part is that I successfully compiled it in the past, why doesn't it work now? It seems to be a problem with qstring.h .
How to fix it? Error occurs here
#ifndef QSTRING_H #define QSTRING_H #if defined(QT_NO_CAST_FROM_ASCII) && defined(QT_RESTRICTED_CAST_FROM_ASCII) #error QT_NO_CAST_FROM_ASCII and QT_RESTRICTED_CAST_FROM_ASCII must not be defined at the same time #endif #include <QtCore/qchar.h> #include <QtCore/qbytearray.h> #include <QtCore/qrefcount.h> #include <QtCore/qnamespace.h> #include <string> #if defined(Q_OS_ANDROID) // std::wstring is disabled on android glibc, as bionic lacks certain features // that libstdc++ checks for (like mbcslen). namespace std { typedef basic_string<wchar_t> wstring; } #endif #if defined(Q_COMPILER_UNICODE_STRINGS) || defined(Q_QDOC) static inline QString fromStdU16String(const std::u16string &s); inline std::u16string toStdU16String() const; static inline QString fromStdU32String(const std::u32string &s); inline std::u32string toStdU32String() const; #endif
source share