Thursday, July 29, 2010

error C2011: '_DDPIXELFORMAT'


c:\program files\microsoft sdks\windows\v6.0\include\ddraw.h(703) : error C2011: '_DDPIXELFORMAT' : 'struct' type redefinition

This is a nice SDK integration error that I have face several times now and figured it is time to chronicle the solution... googling the issues does not net much that is helpful...

so I know this is a PCH issue, initially stdafx.h was this
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once

#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0502 // Change this to the appropriate value to target other versions of Windows.
#endif

#include
#include



// TODO: reference additional headers your program requires here
//#include
#include
#include

and then I added:
#include
#if (MSC_VER <>
#include
#endif

and the error goes away....

1 comment:

  1. Compiler Error C2470 'function' : looks like a function definition, but there is no formal parameter list; skipping apparent body

    now this can be as simple as a bad Macro definition, such as one that is controlling the definition of IMEXP, which is usually tied to __declspec etc...

    ReplyDelete

Note: Only a member of this blog may post a comment.