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.
  • nicker playerN Offline
    nicker playerN Offline
    nicker player
    wrote on 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.

    JonBJ 1 Reply Last reply
    0
    • nicker playerN nicker player

      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.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on 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

      nicker playerN 1 Reply Last reply
      0
      • JonBJ JonB

        @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

        nicker playerN Offline
        nicker playerN Offline
        nicker player
        wrote on 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|.......

        JonBJ 1 Reply Last reply
        0
        • nicker playerN nicker player

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

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on 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?

          nicker playerN 1 Reply Last reply
          0
          • JonBJ JonB

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

            nicker playerN Offline
            nicker playerN Offline
            nicker player
            wrote on 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.

            JonBJ 1 Reply Last reply
            0
            • nicker playerN nicker player

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

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on 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.

              nicker playerN 1 Reply Last reply
              0
              • JonBJ JonB

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

                nicker playerN Offline
                nicker playerN Offline
                nicker player
                wrote on 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.

                jsulmJ 1 Reply Last reply
                0
                • nicker playerN nicker player

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

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 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

                  • Login

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