我搞了一个视频抓帧的程序,其中qedit.h文件与D3D 的文件有问题;
具体是d3dx9.h D3DApp.h D3DFont.h 与qedit.h不能共存,出现一下错误:
should not include d3dtypes.h when compiling for DX8 or newer interfaces
D:\DXSDK\Include\d3drmobj.h(46) : warning C4005: 'WIN_TYPES' : macro redefinition
D:\DXSDK\Include\dxfile.h(48) : see previous definition of 'WIN_TYPES'
D:\DXSDK\Include\d3drmobj.h(274) : error C2061: syntax error : identifier 'LPDIRECT3D'
D:\DXSDK\Include\d3drmobj.h(299) : error C2061: syntax error : identifier 'LPDIRECT3DDEVICE'
D:\DXSDK\Include\d3drmobj.h(314) : error C2061: syntax error : identifier 'LPDIRECT3D'
D:\DXSDK\Include\d3drmobj.h(339) : error C2061: syntax error : identifier 'LPDIRECT3DDEVICE'
D:\DXSDK\Include\d3drmobj.h(344) : error C2061: syntax error : identifier 'LPDIRECT3D2'
D:\DXSDK\Include\d3drmobj.h(348) : error C2061: syntax error : identifier 'LPDIRECT3DDEVICE2'
D:\DXSDK\Include\d3drmobj.h(363) : error C2061: syntax error : identifier 'LPDIRECT3D'
D:\DXSDK\Include\d3drmobj.h(388) : error C2061: syntax error : identifier 'LPDIRECT3DDEVICE'
D:\DXSDK\Include\d3drmobj.h(393) : error C2061: syntax error : identifier 'LPDIRECT3D2'
D:\DXSDK\Include\d3drmobj.h(397) : error C2061: syntax error : identifier 'LPDIRECT3DDEVICE2'
D:\DXSDK\Include\d3drmobj.h(454) : error C2061: syntax error : identifier 'LPDIRECT3DVIEWPORT'
D:\DXSDK\Include\d3drmobj.h(500) : error C2061: syntax error : identifier 'LPDIRECT3DVIEWPORT'
D:\DXSDK\Include\d3drm.h(74) : error C2061: syntax error : identifier 'LPDIRECT3D'
D:\DXSDK\Include\d3drm.h(156) : error C2061: syntax error : identifier 'LPDIRECT3D2'
D:\DXSDK\Include\d3drm.h(240) : error C2061: syntax error : identifier 'LPDIRECT3D2' j
解决方法:
#include "stdafx.h"的下一行,加上#define __D3DRM_H__ 就好了