[Development] ActiveQt AxServer with CMake

Fricot, Daniel daniel.fricot at barco.com
Thu Feb 13 16:43:15 CET 2014


SOLVED!
Adding WIN32 to cmake add_executable statement did it!

Thank you Thomas for pointing this out, I completely overlooked this.
Also many thanks to Stephen and Rob for their help.

-----Original Message-----
From: development-bounces+daniel.fricot=barco.com at qt-project.org [mailto:development-bounces+daniel.fricot=barco.com at qt-project.org] On Behalf Of Thomas Sondergaard
Sent: donderdag 13 februari 2014 14:21
To: development at qt-project.org
Subject: Re: [Development] ActiveQt AxServer with CMake

On 2014-02-13 13:47, Fricot, Daniel wrote:
> Rob,
> Your cmake snippet is basically what I do in my build.
> Idc is the problem. This gives the " Timers can only be used with
> threads started with QThread" error.
> After some more playing around, I noticed something. If I place a
> breakpoint in the beginning of my main, I got the following stacktrace
> (build with cmake, without IDL commands):
>      0    main                 main.cpp    44     0x81ea7
>      1    __tmainCRTStartup    crtexe.c    536    0xafad9
>      2    mainCRTStartup       crtexe.c    377    0xafc1d
>      3    BaseThreadInitThunk  kernel32           0x76f8336a
>      4    __RtlUserThreadStart ntdll              0x77979f72
>      5    _RtlUserThreadStart  ntdll              0x77979f45
> If I do the same with something I build with qmake (which does the IDL
> commands for you), I got:
>      0    main                 main.cpp           252    0x1002ad6
> *1    WinMain              qaxservermain.cpp  260    0x101bdb1*
>      2    __tmainCRTStartup    crtexe.c           528    0x102fb62
>      3    WinMainCRTStartup    crtexe.c           377    0x102f92d
>      4    BaseThreadInitThunk  kernel32                  0x76f8336a
>      5    __RtlUserThreadStart ntdll                     0x77979f72
>      6    _RtlUserThreadStart  ntdll                     0x77979f45
> (Note that the main.cpp in the two stacktraces are two different
> files, so don't mind the difference in line numbers in main.cpp) As
> you can see, in the activeqt server, build with qmake, the main is
> called from WinMain in qaxservermain.cpp. I don't know if this is the
> result of the IDL commands (in which case, the cmake build obviously
> does not have the WinMain in the stacktrace) or this should also be in
> the stacktrace of the cmake build, even before running the IDL commands?
> Thanks,
> Daniel


It looks like you are building a .exe. Do you have WIN32 in your add_executable statement? qaxservermain.cpp (in the Qt 4.8 source I have lying around) provides a WinMain() that will call ::main().

Regards,
Thomas


_______________________________________________
Development mailing list
Development at qt-project.org
http://lists.qt-project.org/mailman/listinfo/development
This message is subject to the following terms and conditions: MAIL DISCLAIMER<http://www.barco.com/en/maildisclaimer>



More information about the Development mailing list