1

I'm currently building a C++ DLL, and I have this at the top of the main DLL .cpp file. This currently is causing the warning "Warning C4005: '_WIN32_WINNT' : macro redefinition". What have I done wrong?

I need to include windows.h, SDKDDKVer.h and set the minimum windows version to XP. How do I correct my code?

// System Includes
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <d3d9.h>

// Windows Version
#define _WIN32_WINNT _WIN32_WINNT_WINXP
#include <SDKDDKVer.h>

1 Answer 1

4

You should include the SDK stuff first:

// Windows Version
#define _WIN32_WINNT 0x0501     // _WIN32_WINNT_WINXP
#include <SDKDDKVer.h>

// System Includes
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <d3d9.h>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.