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. How to solve the problem C++17 std::byte and win sdk byte namespace ambigus
Forum Updated to NodeBB v4.3 + New Features

How to solve the problem C++17 std::byte and win sdk byte namespace ambigus

Scheduled Pinned Locked Moved Unsolved Qt 6
8 Posts 3 Posters 2.0k Views
  • 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.
  • N Offline
    N Offline
    nicker player
    wrote on 29 Jun 2022, 07:41 last edited by
    #1

    when i used the windows sdk then i found the byte defined named ambigus.
    some one told me about "_HAS_STD_BYTE=0"
    but i pressed the code seemed dosent work.
    So how to solve it?
    By the way,Im using the qt5.14&mingw32 compile program.

    J 1 Reply Last reply 29 Jun 2022, 08:28
    0
    • N nicker player
      29 Jun 2022, 07:41

      when i used the windows sdk then i found the byte defined named ambigus.
      some one told me about "_HAS_STD_BYTE=0"
      but i pressed the code seemed dosent work.
      So how to solve it?
      By the way,Im using the qt5.14&mingw32 compile program.

      J Offline
      J Offline
      JonB
      wrote on 29 Jun 2022, 08:28 last edited by JonB
      #2

      @nicker-player
      Somebody asked this question recently. I suggested they try putting the #include <windows.h> directive as the very first line in whichever .cpp file(s), before including any Qt stuff. And they said that worked, try it?
      Ahh, found page: https://forum.qt.io/topic/137337/including-windows-h-gives-error

      N 1 Reply Last reply 29 Jun 2022, 09:22
      0
      • J JonB
        29 Jun 2022, 08:28

        @nicker-player
        Somebody asked this question recently. I suggested they try putting the #include <windows.h> directive as the very first line in whichever .cpp file(s), before including any Qt stuff. And they said that worked, try it?
        Ahh, found page: https://forum.qt.io/topic/137337/including-windows-h-gives-error

        N Offline
        N Offline
        nicker player
        wrote on 29 Jun 2022, 09:22 last edited by
        #3

        @JonB
        In fact it dosent work
        I put the code with config += c++17 alone with the single project it could run.So i think it not the major reason.
        When i messured these codes into the whole project,It cames the bugs of ambigus.
        Cause i dont know where I included the wrong head files ,so many files to lookfor .And in fact i dont know how to solve the problem in your way|.......

        J 1 Reply Last reply 29 Jun 2022, 09:26
        0
        • N nicker player
          29 Jun 2022, 09:22

          @JonB
          In fact it dosent work
          I put the code with config += c++17 alone with the single project it could run.So i think it not the major reason.
          When i messured these codes into the whole project,It cames the bugs of ambigus.
          Cause i dont know where I included the wrong head files ,so many files to lookfor .And in fact i dont know how to solve the problem in your way|.......

          J Offline
          J Offline
          JonB
          wrote on 29 Jun 2022, 09:26 last edited by JonB
          #4

          @nicker-player said in How to solve the problem C++17 std::byte and win sdk byte namespace ambigus:

          In fact it dosent work

          Well it worked for the other person. I don't see any relevance to c++17. Did you even try what I said about the #include <windows.h>, because you do not say anything about that?

          N 1 Reply Last reply 29 Jun 2022, 09:46
          0
          • J JonB
            29 Jun 2022, 09:26

            @nicker-player said in How to solve the problem C++17 std::byte and win sdk byte namespace ambigus:

            In fact it dosent work

            Well it worked for the other person. I don't see any relevance to c++17. Did you even try what I said about the #include <windows.h>, because you do not say anything about that?

            N Offline
            N Offline
            nicker player
            wrote on 29 Jun 2022, 09:46 last edited by
            #5

            @JonB
            I used the third part dll named 7z.dll
            And i dont know where to fix the include <windows.h>
            I include the windows.h in the preheadfile but it doesent work.

            J 1 Reply Last reply 29 Jun 2022, 09:51
            0
            • N nicker player
              29 Jun 2022, 09:46

              @JonB
              I used the third part dll named 7z.dll
              And i dont know where to fix the include <windows.h>
              I include the windows.h in the preheadfile but it doesent work.

              J Offline
              J Offline
              JonB
              wrote on 29 Jun 2022, 09:51 last edited by
              #6

              @nicker-player said in How to solve the problem C++17 std::byte and win sdk byte namespace ambigus:

              And i dont know where to fix the include <windows.h>

              I said to you: before anything Qt is included. That would be for <windows.h> or for whatever you use which could include that, such as whatever you include for 7z.dll, which you do not mention.

              N 1 Reply Last reply 30 Jun 2022, 01:11
              0
              • J JonB
                29 Jun 2022, 09:51

                @nicker-player said in How to solve the problem C++17 std::byte and win sdk byte namespace ambigus:

                And i dont know where to fix the include <windows.h>

                I said to you: before anything Qt is included. That would be for <windows.h> or for whatever you use which could include that, such as whatever you include for 7z.dll, which you do not mention.

                N Offline
                N Offline
                nicker player
                wrote on 30 Jun 2022, 01:11 last edited by
                #7

                @JonB
                I include the windows.h in the preheadfile but it doesent work.
                Did you mean that
                I put the <windows.h> into the preheader file of the project.
                Is it right ?I just did like i've mentioned but it also dosent work.

                J 1 Reply Last reply 30 Jun 2022, 07:08
                0
                • N nicker player
                  30 Jun 2022, 01:11

                  @JonB
                  I include the windows.h in the preheadfile but it doesent work.
                  Did you mean that
                  I put the <windows.h> into the preheader file of the project.
                  Is it right ?I just did like i've mentioned but it also dosent work.

                  J Online
                  J Online
                  jsulm
                  Lifetime Qt Champion
                  wrote on 30 Jun 2022, 07:08 last edited by
                  #8

                  @nicker-player said in How to solve the problem C++17 std::byte and win sdk byte namespace ambigus:

                  I put the <windows.h> into the preheader file of the project.

                  No
                  In the file where you have

                  #include <windows.h>
                  

                  make sure it is above any Qt header includes.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0

                  1/8

                  29 Jun 2022, 07:41

                  • Login

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