Does the same problem happen if using qmake instead of qbs?
There is a qtmain.lib static library that should be added automatically to 
windows executables, which provides the WinMain entry point.

--

From: development-bounces+shane.kearns=accenture....@qt-project.org 
[mailto:development-bounces+shane.kearns=accenture....@qt-project.org] On 
Behalf Of Loaden
Sent: 05 July 2012 04:15
To: development
Subject: [Development] Qt5 beta, MinGW: undefined reference to `WinMain@16'

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'<mailto:%60WinMain@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'<mailto:%60WinMain@16'>
collect2: ld returned 1 exit status
--

Please don't ask where I come from, It's a shame!
Best Regards
Yuchen


________________________________
Subject to local law, communications with Accenture and its affiliates 
including telephone calls and emails (including content), may be monitored by 
our systems for the purposes of security and the assessment of internal 
compliance with Accenture policy.
______________________________________________________________________________________

www.accenture.com
_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to