Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-94031

FILE_ID_INFO is redefined when using MinGW-w64 version 9.0.0

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 6.1.0
    • Fix Version/s: 6.2.1, 6.3.0 Alpha
    • Component/s: Core: I/O
    • Labels:
      None
    • Environment:
      Windows with MinGW-w64 9.0.0 and GCC 11 (see https://winlibs.com/) both targetting Windows 32-bit as Windows 64-bit.
    • Platform/s:
      Windows
    • Commits:
      4ddbfb68f858aee45cf7c33718f16b6c7b5beed7 (qt/qtbase/dev) d5ad37b094a3ea1e24f343994bf7b6d5cd2df974 (qt/qtbase/6.2)

      Description

      A few days MinGW-w64 version 9.0.0 was released.

      I have built the latest GCC and LLVM toolchains against it (see https://winlibs.com/) and tried to build Qt with it.

      It works except for one issue: FILE_ID_INFO and PFILE_ID_INFO are redefined in qtbase/src/corelib/io/qfilesystemengine_win.cpp.

      I was able to solve the issue by changing:

      #if defined(Q_CC_MINGW) && WINVER < 0x0602 // Windows 8 onwards
      typedef struct _FILE_ID_INFO {
        ULONGLONG VolumeSerialNumber;
        FILE_ID_128 FileId;
      } FILE_ID_INFO, *PFILE_ID_INFO;
      #endif // if defined (Q_CC_MINGW) && WINVER < 0x0602
      

      to:

      #if defined(Q_CC_MINGW) && WINVER < 0x0602 && !(_WIN32_WINNT >= _WIN32_WINNT_WIN8) // Windows 8 onwards
      typedef struct _FILE_ID_INFO {
        ULONGLONG VolumeSerialNumber;
        FILE_ID_128 FileId;
      } FILE_ID_INFO, *PFILE_ID_INFO;
      #endif // if defined (Q_CC_MINGW) && WINVER < 0x0602
      

      This way it builds, but to know if this is the best way to patch it you need to make sure it doesn't break MSVC builds.

      I had the same issue with Qt 5.15.2 and Qt 6.1.0, and both times this solution worked.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            owolff Oliver Wolff
            Reporter:
            brechtsanders Brecht Sanders
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes