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

Undefined reference to WinMain with MinGW

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.3.0 Alpha
    • 6.0.0
    • Build System: CMake
    • None
    • Windows
    • 753199437943e2a89e458136fd11a5a43443b280 (qt/qtbase/dev) 34cf8355687fc0c0f8544c3ccb3e6f9c05621955 (qt/qtbase/6.2)

    Description

      VRonin discovered a problem that in some cases linking of an executable fails with Qt6/CMake and MinGW due to the missing symbol 'WinMain'. The discussion can be found in the forum. The code is on github but I can attach them if you want.

      The reason seems to be that libQt6EntryPoint.a is not added after -lmingw32.

      This only happens when the created library links PRIVATE against all Qt libraries and then the executable links against this library and the Qt libraries. As soon as the library links PUBLIC against the Qt libraries all is fine.

      I tried to dig through the cmake scripts but got stuck at Qt6EntryPoints.cmake - for some reason INTERFACE_LINK_LIBRARIES for Qt6::EntryPointImplementation is empty...

      Attachments

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

        Activity

          People

            jbornema Joerg Bornemann
            chehrlic Christian Ehrlicher
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes