在Visual Studio 2003(vs2003) 中编译DirectX自带的DxViewer示例时不能通过编译,解决方案如下:
1、dxviewer工程设置中去掉bufferoverflowu.lib依赖
2、d3d10.h头文件中__d3d10_h__宏定义之后添加如下代码:
#ifndef __out
#define __out
#endif
#ifndef __in
#define __in
#endif
#ifndef __inout
#define __inout
#endif
#ifndef __in_opt
#define __in_opt
#endif
#ifndef __out_opt
#define __out_opt
#endif
#ifndef __inout_opt
#define __inout_opt
#endif
#ifndef __in_ecount
#define __in_ecount(x)
#endif
#ifndef __in_ecount_opt
#define __in_ecount_opt(x)
#endif
#ifndef __out_ecount
#define __out_ecount(x)
#endif
#ifndef __out_ecount_opt
#define __out_ecount_opt(x)
#endif
#ifndef __inout_ecount
#define __inout_ecount(x)
#endif
#ifndef __inout_ecount_opt
#define __inout_ecount_opt(x)
#endif
#ifndef __in_bcount_opt
#define __in_bcount_opt(x)
#endif
#ifndef __out_bcount_opt
#define __out_bcount_opt(x)
#endif
#ifndef __inout_bcount_opt
#define __inout_bcount_opt(x)
#endif
3、在工程设置中设置延迟加载 d3dx10d.dll (如果编译Release版就是d3dx10.dll)
ps: 发现编辑时代码的插入功能做的很烂呢,代码只能是在文章头部,而且之后再添加非代码文本也会被放到代码区域中。