作者pleaselouis (LOUISN)
看板GameDesign
标题[程式] D3D与DSHOW共用的问题
时间Sat May 6 17:48:22 2006
小弟我准备写一个D3D与DSHOW共用的程式
现在已经把DSHOW的部分写好了 准备开始写D3D部分 但是一开始include d3d8.h 还OK
但是只要一include其他D3D的.h档案就会有 error
我在DSHOW中所使用的.h档案如下
#include <atlbase.h>
#include <streams.h>
#include <qedit.h>
#include <objbase.h>
我把这些.H档 包在一个名叫wcam.h的档案
下面这样的情况是可以的
#include "wcam.h"
#include "d3d8.h"
但若是如下面这样
#include "wcam.h"
#include "d3d8.h"
#include "d3dx8.h"
就会出现如下的错误讯息
c:\dxsdk\include\d3dx8math.h(627) : error C2143: syntax error : missing ',' befo
re '*'
c:\dxsdk\include\d3dx8math.h(627) : error C2059: syntax error : '*'
c:\dxsdk\include\d3dx8math.h(632) : error C2143: syntax error : missing ',' befo
re '*'
c:\dxsdk\include\d3dx8math.h(632) : error C2059: syntax error : '*'
c:\dxsdk\include\d3dx8math.inl(484) : error C2065: 'm' : undeclared identifier
c:\dxsdk\include\d3dx8math.inl(484) : error C2109: subscript requires array or p
ointer type
c:\dxsdk\include\d3dx8math.inl(484) : error C2109: subscript requires array or p
ointer type
c:\dxsdk\include\d3dx8math.inl(484) : error C2440: 'return' : cannot convert fro
m 'int' to 'float &'A reference that is not to 'const' cannot be bound to a non-
lvalue
<因为太长 中间恕删>
c:\dxsdk\include\d3dx8tex.h(496) : warning C4229: anachronism used : modifiers o
n data are ignored
c:\dxsdk\include\d3dx8tex.h(505) : error C2059: syntax error : ')'
c:\dxsdk\include\d3dx8tex.h(531) : error C2061: syntax error : identifier 'LPDIR
ECT3DSURFACE8'
c:\dxsdk\include\d3dx8tex.h(539) : error C2061: syntax error : identifier 'LPDIR
ECT3DSURFACE8'
c:\dxsdk\include\d3dx8tex.h(597) : error C2065: 'LPDIRECT3DVOLUME8' : undeclared
identifier
c:\dxsdk\include\d3dx8tex.h(597) : fatal error C1003: error count exceeds 100; s
topping compilation
Error executing cl.exe.
NewGame.exe - 102 error(s), 13 warning(s)
-----
但若是我把include的顺序对调 如下
#include "d3d8.h"
#include "wcam.h"
则会出现如下错误
should not include d3dtypes.h when compiling for DX8 or newer interfaces
c:\dxsdk\include\d3drmobj.h(274) : error C2061: syntax error : identifier 'LPDIR
ECT3D'
c:\dxsdk\include\d3drmobj.h(299) : error C2061: syntax error : identifier 'LPDIR
ECT3DDEVICE'
c:\dxsdk\include\d3drmobj.h(314) : error C2061: syntax error : identifier 'LPDIR
ECT3D'
c:\dxsdk\include\d3drmobj.h(339) : error C2061: syntax error : identifier 'LPDIR
ECT3DDEVICE'
c:\dxsdk\include\d3drmobj.h(344) : error C2061: syntax error : identifier 'LPDIR
ECT3D2'
c:\dxsdk\include\d3drmobj.h(348) : error C2061: syntax error : identifier 'LPDIR
ECT3DDEVICE2'
c:\dxsdk\include\d3drmobj.h(363) : error C2061: syntax error : identifier 'LPDIR
ECT3D'
c:\dxsdk\include\d3drmobj.h(388) : error C2061: syntax error : identifier 'LPDIR
ECT3DDEVICE'
c:\dxsdk\include\d3drmobj.h(393) : error C2061: syntax error : identifier 'LPDIR
ECT3D2'
c:\dxsdk\include\d3drmobj.h(397) : error C2061: syntax error : identifier 'LPDIR
ECT3DDEVICE2'
c:\dxsdk\include\d3drmobj.h(454) : error C2061: syntax error : identifier 'LPDIR
ECT3DVIEWPORT'
c:\dxsdk\include\d3drmobj.h(500) : error C2061: syntax error : identifier 'LPDIR
ECT3DVIEWPORT'
c:\dxsdk\include\d3drm.h(74) : error C2061: syntax error : identifier 'LPDIRECT3
D'
c:\dxsdk\include\d3drm.h(156) : error C2061: syntax error : identifier 'LPDIRECT
3D2'
c:\dxsdk\include\d3drm.h(240) : error C2061: syntax error : identifier 'LPDIRECT
3D2'
Error executing cl.exe.
NewGame.exe - 15 error(s), 0 warning(s)
请知道解决方法的前辈教教小弟 真的是非常感谢 拜托了 <(_ _)>
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.167.43.134
1F:推 DreamYeh:看来是重复引档的错误,按照你能过的那个顺序吧:) 05/08 14:16