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

    • Bug
    • Resolution: Done
    • P1: Critical
    • 6.2.1, 6.3.0 Alpha
    • 6.1.0
    • Core: I/O
    • None
    • Windows with MinGW-w64 9.0.0 and GCC 11 (see https://winlibs.com/) both targetting Windows 32-bit as Windows 64-bit.
    • Windows
    • 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

        For Gerrit Dashboard: QTBUG-94031
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes