Unsolved QbyteArrayViewer and std::byte
-
Hi,
i'm using Qbytearray idn a qt project. In 5.xx.x. compiling worked fine. I had QMAKE_CXXFLAGS += /D_HAS_STD_BYTE=0 in the .pro file since there wer ambig. symbols when working with the windows headers.
Now when compiling under Qt6 the header for QByteArrayViewerhas a std::byte inside which is now with the above setting an undefined identifier. What can i do?
-
-
This is the file in question:
..\Qt\6.2.3\msvc2019_64\include\QtCore\qbytearrayview.h
line 54:
struct IsCompatibleByteTypeHelper
: std::integral_constant<bool,
std::is_same_v<Byte, char> ||
std::is_same_v<Byte, uchar> ||
std::is_same_v<Byte, signed char>
std::is_same_v<Byte, std::byte>> {};results in a lot of errors but mainly:
..\Qt\6.2.3\msvc2019_64\include\QtCore\qbytearrayview.h:59: Fehler: C2039: "byte" ist kein Member von "std".
byte is not a member of the std namespace
this makes sense because of
QMAKE_CXXFLAGS += /D_HAS_STD_BYTE=0If i setit to 1 i will get problems with the windows headers -> ambig. symbols..
What do you mean with explicit typecast? I don't want to change the qt header.
-
@ck_ee said in QbyteArrayViewer and std::byte:
If i setit to 1 i will get problems with the windows headers -> ambig. symbols
Which Windows headers? Which compiler version? Which Windows SDK version?
I'm using MSVC 2019 (Visual Studio version 16.11.9) with Windows SDK 10.0.18362.0 and I don't get any errors about ambiguous symbols when I do
#include <QByteArrayView>
Try changing your #include order -- include the Qt headers before the Windows headers.
What do you mean with explicit typecast? I don't want to change the qt header.
Sorry, I thought you meant you got an error about ambiguous symbols in your own code. I agree, you shouldn't change the Qt header.
-
@ck_ee I have the exact same issue. Did you manage to solve it?