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

[Reg 5.15->6.x] CONFIG += qt causes failure to link to WinMain

    XMLWordPrintable

Details

    • Windows
    • b289d669a (dev), ab971d249 (6.6), c6ec130a0 (6.5)

    Description

      MinGW kits do not seem to be affected.

       

      Code

      MyProject.pro

      CONFIG += qt
      SOURCES += main.cpp
      

       

      main.cpp

      #include <QGuiApplication>
      int main(int, char**)
      {
          qDebug("Hello World");
      }
      

       

      Build Output

      	link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:debug\MyProject.exe @C:\Users\USER\AppData\Local\Temp\MyProject.exe.29120.2047.jom
      MSVCRTD.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)
      debug\MyProject.exe : fatal error LNK1120: 1 unresolved externals
      

       

      Workarounds

      • Remove CONFIG += qt and clean the build folder, OR
      • Add QT += entrypoint_private

      Attachments

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

        Activity

          People

            jbornema Joerg Bornemann
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes