Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-125

MinGW: undefined reference to `WinMain@1​6'

    XMLWordPrintable

Details

    Description

      main.cpp

      #include <QCoreApplication>
      int main(int argc, char **argv)
      {
          QCoreApplication app(argc, argv);
          return app.exec();
      }
      

      test.qbp

      import qbs.base 1.0
      Application {
          name : "Test"
          Depends {
              name: "Qt.widgets"
          }
          files : [
              "main.cpp"
          ]
      }
      

      MinGW-TDM32:

      Found project file D:\qpSOFT\Projects\Test\test.qbp
      loading project took: 79 ms
      build graph took: 14 ms
      for t86-tdm-mingw32-release:

      • [hpp, application] Test as t86-tdm-mingw32-release
        compiling main.cpp
        linking Test.exe
        D:\qpSOFT\MinGW\TDM-MinGW32\bin/g++ -O2 -Wall -W D:/qpSOFT/Projects/Test/build/t86-tdm-mingw32-relea
        se/.obj/Test/main.o -o D:/qpSOFT/Projects/Test/build/t86-tdm-mingw32-release/Test.exe -LD:/qpSOFT/Pr
        ojects/BuildQt5-t86/qtbase/lib -lqtmain -lQtCore5 -lQtGui5 -lQtWidgets5
        d:/qpsoft/mingw/tdm-mingw32/bin/../lib/gcc/mingw32/4.6.1/../../../libmingw32.a(main.o): In function
        `main':
        C:\MinGW\msys\1.0\src\mingwrt/../mingw/main.c:73: undefined reference to `WinMain@16'
        collect2: ld returned 1 exit status

      MinGW-w64

      D:\qpSOFT\MinGW\MinGW32\bin/g++ -m32 -O2 -Wall -W D:/qpSOFT/Projects/Test/build/m86-mingw32-release/
      .obj/Test/main.o -o D:/qpSOFT/Projects/Test/build/m86-mingw32-release/Test.exe -LD:/qpSOFT/Projects/
      BuildQt5-m86/qtbase/lib -lqtmain -lQtCore5 -lQtGui5 -lQtWidgets5
      d:/qpsoft/mingw/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/lib/../li
      b/libmingw32.a(lib32_libmingw32_a-crt0_c.o): In function `main':
      /home/ruben/mingw-w64/toolchain/src/mingw-w64/tags/v2.0.3/mingw-w64-crt/crt/crt0_c.c:18: undefined r
      eference to `WinMain@16'
      collect2: ld returned 1 exit status

      qmake with the same issue.

      Attachments

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

        Activity

          People

            jbornema Joerg Bornemann
            loaden Yuchen Deng
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes