[Interest] unresolved WinMain on porting to Qt 6

Hamish Moffatt hamish at risingsoftware.com
Mon Jun 26 06:46:14 CEST 2023


On 23/6/23 22:16, Henry Skoglund wrote:
> On 2023-06-23 07:15, Hamish Moffatt via Interest wrote:
>>
>> If I add the linker flag /ENTRY:mainCRTStartup then it builds. What's 
>> the correct Qt solution for this though?
>>
>
> The fact that adding /ENTRY:mainCRTStartup helped implies that you're 
> linking with /SUBSYSTEM:CONSOLE and not /SUBSYSTEM:WINDOWS, i.e. 
> defaulting to console flavor.
> Maybe you forgot "QT += widgets" in the .pro file (just guessing :-) 


That wasn't it (widgets were including and linking fine), but what I 
figured out is that the magic helper in Qt5 qtmain is now the library 
Qt6EntryPoint, and for some reason that wasn't being linked. Reading the 
qmake debug logs, the entrypoint-private module gets added to QT_PRIVATE 
during processing but then vanishes before it's used. In a test 
application, the entrypoint-private module then adds 
entrypoint-implementation which links the library and all is good.

I have no idea why entrypoint-private is disappearing from QT_PRIVATE, 
but I just added entrypoint-implementation to QT directly and I'll live 
with that for now.

Hamish



More information about the Interest mailing list