Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Switched from Qt 5 to Qt 6
Forum Updated to NodeBB v4.3 + New Features

Switched from Qt 5 to Qt 6

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 463 Views 2 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.
  • M Offline
    M Offline
    Mourad2024
    wrote on last edited by
    #1

    "Hello everyone,
    I am coding in C++/Qt, and I just switched from Qt 5 to Qt 6. Besides the numerous errors I've already fixed, there is one error that I don't understand, and it's the following:"

    1 - C:\Qt\Tools\mingw1310_64\x86_64-w64-mingw32\include\objidlbase.h:2026: erreur : 'byte' has not been declared
    In file included from C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/combaseapi.h:155,
                     from C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/objbase.h:14,
                     from C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/ole2.h:17,
                     from C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/wtypes.h:13,
                     from C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/winscard.h:10,
                     from C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/windows.h:97,
                     from C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/winsock2.h:23,
                     from C:/Data/Fichiers_applications/C++/LibrairiesExternes/curl-8.8.0_1-win64-mingw/include/curl/curl.h:73,
                     from ..\..\Facturation\../Gestion/libcurlmodifiee.h:7,
                     from ..\..\Facturation\fen_de_facturation.h:51,
                     from ..\..\Facturation\fen_de_facturation.cpp:1:
    C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/objidlbase.h:2026:5: error: 'byte' has not been declared
     2026 |     byte *pv,
          
    2 - C:\Qt\Tools\mingw1310_64\x86_64-w64-mingw32\include\objidlbase.h:2026: erreur : reference to 'byte' is ambiguous
    In file included from C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/combaseapi.h:155,
                     from C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/objbase.h:14,
                     from C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/ole2.h:17,
                     from C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/wtypes.h:13,
                     from C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/winscard.h:10,
                     from C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/windows.h:97,
                     from C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/winsock2.h:23,
                     from C:/Data/Fichiers_applications/C++/LibrairiesExternes/curl-8.8.0_1-win64-mingw/include/curl/curl.h:73,
                     from ..\..\Facturation\../Gestion/libcurlmodifiee.h:7,
                     from ..\..\Facturation\fen_de_facturation.h:51,
                     from ..\..\Facturation\fen_de_facturation.cpp:1:
    C:/Qt/Tools/mingw1310_64/x86_64-w64-mingw32/include/objidlbase.h:2026:5: error: reference to 'byte' is ambiguous
     2026 |     byte *pv,
    

    if anyone can help me please.
    Thanks in advance to all.

    1 Reply Last reply
    0
    • Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      That's probably due to a change in the C++ version.
      Check your headers for using namespace std and remove it.

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      6
      • J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        To add on to @Axel-Spoerl

        std::byte is a thing since c++17

        I think Qt6 requires c++17 now by default ? Anyway in your own code you have somewhere a byte type and the compiler is now confusing those too

        Pro tipp namespaces are a thing use them :p

        I had the same issue where I had a byte(order) enum type that caused all kind of problems, changed it to a capital B and that solved it.


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        4
        • M Offline
          M Offline
          Mourad2024
          wrote on last edited by
          #4

          Hello,

          Thank you 'Hilk' for your response. I will test that this weekend and will keep you updated.

          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