[Qt-interest] [ActiveQt]WINVER set incorrectly
Tony Rietwyk
tony.rietwyk at rightsoft.com.au
Thu Dec 4 00:36:25 CET 2008
Jonathon wrote:
> I'm using the ActiveQt library to create an ActiveX component
> that uses
> another proprietary interface. To do this, my class subclasses
> QAxAggregated, as well as the custom interface class. I have
> the IDL for
> the interface, and I've used MIDL to generate the .h and .c files.
> However, when I try to compile my project, I get an error from the
> <interface>_p.c file generated by MIDL - it tells me that I
> need to be
> using Windows 2000 or later in order to run this stub. However, I am
> using Windows XP SP2. The error in question is thrown by a
> preprocessor
> statement, which checks a define called TARGET_IS_NT50_OR_LATER. That
> define is set in rpcndr.h, based on _WIN32_WINNT and WINVER.
>
> In summary, my compiler is incorrectly assuming that I'm
> using something
> earlier than Windows 2000 when I'm actually using Windows XP.
> I see that
> when moc is run on my files, one of the arguments passed to it is to
> define WINVER as 0x501 (ie Windows XP). If I manually define WINVER
> myself in my Visual Studio project settings, I get an error from moc
> saying I cant pass it more than one input file. Defining WINVER in my
> class or in the <interface>_p.c has no effect, but defining
> TARGET_IS_NT50_OR_LATER as 1 does of course let me compile that file.
> However, I get linker errors later on, so I'm guessing that
> the cause of
> the compiler guessing that I am using the wrong version of
> windows might
> well be involved.
>
> I am using Visual Studio 2005 on Windows XP SP2, and I do include
> windows.h in my main class header file.
>
> Any help would be appreciated.
Hi Jonathon,
Have you applied VS2005 SP1? You will get linker errors if you try to use
precompiled Qt for VS2005 without applying the VS service pack.
Hope that helps,
Tony Rietwyk
More information about the Qt-interest-old
mailing list