Posted By: Dodo | Apr 20th @ 3:04 PM
page 1 of 1
Comments: 4 | Views: 824
Dodo
Dodo
I'm your creativity creator™ :)
I'm doing the following:

<BR>#include <windows.h><BR>#define _WIN32_WINNT 0x0400


This will however always result in this:
sourcefile(line) : warning C4005: '_WIN32_WINNT' : macro redefinition
        c:\program files\microsoft sdks\windows\v6.0a\include\sdkddkver.h(151) : see previous definition of '_WIN32_WINNT'
It's only defined once. How do I fix this without setting _WIN32_WINNT to 0x0501?
CannotResolveSymbol
CannotResolveSymbol
{insert caption here}
C preprocessor directives are processed in the order they are found in the source file, so you need to define _WIN32_WINNT before you include <windows.h> or it won't affect anything in windows.h.  Windows.h defines a default value for _WIN32_WINNT if you don't specify a value before including it.

Take a look at stdafx.h and targetver.h in the default Win32 project template (what you get if you don't specify "Empty Project" in the wizard) for an example.
Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...
I just tried:

#define _WIN32_WINNT 0x0400<BR>#include <windows.h>


And it worked fine in VC9. So what's your problem?
I believe the SDK that ships with VS9 doesn't officially support Windows prior to 2000, so even if you manually define the NT4 target there is no guarantee that it will work. You'd need to install and configure an older SDK version to guarantee NT4 targetting, but then that's probably not guaranted to work in VS9.
page 1 of 1
Comments: 4 | Views: 824
Microsoft Communities