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. error redefinition of 'struct _FILE_ID_INFO'
Forum Updated to NodeBB v4.3 + New Features

error redefinition of 'struct _FILE_ID_INFO'

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 6 Posters 2.1k Views 1 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.
  • N Offline
    N Offline
    Nan Feng
    wrote on last edited by
    #1

    Hi, dear community members. Today I tried to compile Qt 5.15.5 with MinGW under Windows, but I got some errors while configuring.

    In file included from d:\opt\mingw64\x86_64-w64-mingw32\include\windows.h:70,
    from F:\qt5\qtbase\src\corelib\global\qt_windows.h:64,
    from F:/qt5/qtbase/include/QtCore/qt_windows.h:1,
    from F:/qt5/qtbase/src/corelib/io/qfilesystemmetadata_p.h:61,
    from F:/qt5/qtbase/src/corelib/io/qfilesystemengine_p.h:56,
    from F:/qt5/qtbase/src/corelib/io/qfilesystemengine_win.cpp:40:
    d:\opt\mingw64\x86_64-w64-mingw32\include\winbase.h:3140:18: note: previous definition of 'struct _FILE_ID_INFO'

    Is there any solution please? I think I use MinGW to compile the Qt 5.15 source code, and I am not the only one who encounters this configuration error. Looking forward to your reply~

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      I would guess the mingw version is too old. Make sure to use the one (or newer) as stated in the documentation.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      N 1 Reply Last reply
      0
      • N Offline
        N Offline
        Nan Feng
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          I would guess the mingw version is too old. Make sure to use the one (or newer) as stated in the documentation.

          N Offline
          N Offline
          Nan Feng
          wrote on last edited by
          #4

          @Christian-Ehrlicher
          First of all, thank you very much for taking the time out of your busy schedule to reply to my post. sincere thanks! The MinGW version I am using is the MinGW 9.X version downloaded from winlibs.com. But after the first failure, I changed the official MinGW version [https://www.mingw-w64.org] and the configuration still failed again. So I tried to modify the file \qtbase\src\corelib\global\qt_windows.h

          The original content is as follows:
          #if defined(Q_CC_MINGW)
          // mingw's windows.h does not set _WIN32_WINNT, resulting breaking compilation
          #ifndef WINVER
          #define WINVER 0x601
          #endif

          ifndef _WIN32_WINNT

          #define _WIN32_WINNT 0x601
          #endif

          ifndef NTDDI_VERSION

          #define NTDDI_VERSION 0x06000000
          #endif
          #endif

          #ifndef NOMINMAX
          #define NOMINMAX
          #endif
          #include <windows.h>

          After modification as follows:
          #include <windows.h>
          #if defined(Q_CC_MINGW)
          // mingw's windows.h does not set _WIN32_WINNT, resulting breaking compilation
          #ifndef WINVER
          #define WINVER 0x601
          #endif

          In fact, #include <windows.h> is placed above the Q_CC_MINGW macro, so that the configuration is successfully passed. But I don't know if this modification will have any incalculable hidden impact on a module function of Qt.

          Looking forward to your reply.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            Why not use the MinGW version that is provided through the Qt installer ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            N 1 Reply Last reply
            0
            • SGaistS SGaist

              Hi,

              Why not use the MinGW version that is provided through the Qt installer ?

              N Offline
              N Offline
              Nan Feng
              wrote on last edited by
              #6

              @SGaist
              Hello and welcome to my post! The Qt online installer provides 5.15.2. And the official has released the source code of Qt 5.15.5. So I want to manually compile the latest version of the 5.15 LTS series. And there will be the source code for 5.15.6 on September 8th. The official binary distribution version is no longer available for open source users, so manual compilation is required. At present, the successful compilation of MSVC has been completed, and it is worse than that of MinGW. . .

              jsulmJ 1 Reply Last reply
              0
              • N Nan Feng

                @SGaist
                Hello and welcome to my post! The Qt online installer provides 5.15.2. And the official has released the source code of Qt 5.15.5. So I want to manually compile the latest version of the 5.15 LTS series. And there will be the source code for 5.15.6 on September 8th. The official binary distribution version is no longer available for open source users, so manual compilation is required. At present, the successful compilation of MSVC has been completed, and it is worse than that of MinGW. . .

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Nan-Feng @SGaist Asked why you do not use MinGW provided by the Qt installer? This version of MinGW is tested with QT and should work...

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

                1 Reply Last reply
                0
                • Q Offline
                  Q Offline
                  QtTester
                  wrote on last edited by QtTester
                  #8

                  I also have this problem, mingw1120_64 from qt6.7 online installer, cannot compile qt5.15.13.

                  2024-05-09_095450.png

                  C 1 Reply Last reply
                  0
                  • Q QtTester

                    I also have this problem, mingw1120_64 from qt6.7 online installer, cannot compile qt5.15.13.

                    2024-05-09_095450.png

                    C Offline
                    C Offline
                    ChrisW67
                    wrote on last edited by
                    #9

                    @QtTester
                    Reported several times:
                    https://bugreports.qt.io/browse/QTBUG-94031
                    https://bugreports.qt.io/browse/QTBUG-101213
                    There's a patch you could make to the 5.x source. The fix has been rolled into Qt6

                    1 Reply Last reply
                    2

                    • Login

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