Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. QbyteArrayViewer and std::byte
Forum Updated to NodeBB v4.3 + New Features

QbyteArrayViewer and std::byte

Scheduled Pinned Locked Moved Unsolved Qt 6
5 Posts 3 Posters 1.2k Views 1 Watching
  • 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.
  • ck_eeC Offline
    ck_eeC Offline
    ck_ee
    wrote on last edited by
    #1

    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?

    JKSHJ 1 Reply Last reply
    0
    • ck_eeC ck_ee

      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?

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      @ck_ee said in QbyteArrayViewer and std::byte:

      What can i do?

      Do an explicit typecast, perhaps?

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • ck_eeC Offline
        ck_eeC Offline
        ck_ee
        wrote on last edited by ck_ee
        #3

        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=0

        If 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.

        JKSHJ U 2 Replies Last reply
        0
        • ck_eeC ck_ee

          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=0

          If 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.

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          @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.

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • ck_eeC ck_ee

            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=0

            If 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.

            U Offline
            U Offline
            UndeadBan
            wrote on last edited by
            #5

            @ck_ee I have the exact same issue. Did you manage to solve it?

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved