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

Qt can't be compiled by gcc under Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 6.3.1
    • None
    • Windows 11 Professional 21H2 22000.832
      g++ version 12.1.0 (Rev3, Built by MSYS2 project)
      Windows Kits 10.0.22621.0 (I know this mismatch the OS version, but it should not matter here)
    • Windows

    Description

      I was building the static version of Qt 6.3.1 from source, under platform win32-g++ (full configure command is shown below)

      However, in the generated Makefile, I found when compiling OOBC in SQL module, it use -isystem "C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um", which is part of Windows Kits, and since it use "-isystem", this path will be searched before the default path in MinGW-W64

      Since headers in this folder is designed for MSVC, with its own features like SAL, it cannot be compiled with MinGW-W64 toolchain, and actually the MinGW has its own windows.h to solve this, but due to -isystem has higher priority, it is hidden.

      Actually, when I removed this "-isystem" manually, the whole project can be compiled successfully.

      I am not clear about where do the Windows Kits comes to be added to include list, but I think this is completely unnecessary.

      My full configure command:

      ..\..\6.3.1\Src\configure.bat -prefix C:/Qt/static/6.3.1 -release -static -platform win32-g++ -c++std c++20 -optimize-size -confirm-license -opensource -static-runtime -opengl desktop -qt-sqlite -qt-pcre -qt-zlib -qt-freetype -qt-harfbuzz -qt-libpng -qt-libjpeg -no-openssl -nomake tools -nomake examples -nomake tests -skip qt3d,qt5compat,qtactiveqt,qtcoap,qtconnectivity,qtdatavis3d,qtdeclarative,qtdoc,qtimageformats,qtlanguageserver,qtlottie,qtmqtt,qtmultimedia,qtnetworkauth,qtopcua,qtpositioning,qtquick3d,qtquicktimeline,qtremoteobjects,qtscxml,qtsensors,qtserialbus,qtserialport,qtshadertools,qttools,qttranslations,qtvirtualkeyboard,qtwayland,qtwebchannel,qtwebengine,qtwebsockets,qtwebview -- -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
      

      Note: Actually I only build qtbase, qtcharts and qtsvg, and the error occurs when compiling OOBC in SQL module included in qtbase, and the vcpkg toolchain is to let CMake could fine zstd, though I'm not sure whether it will cause this problem

      Attachments

        1. cmake_trace.zip
          3.87 MB
        2. vcpkg.cmake
          40 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            dragon-archer Archer Dragon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes