[程式] D3D與DSHOW共用的問題
小弟我準備寫一個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
推
05/08 14:16, , 1F
05/08 14:16, 1F
GameDesign 近期熱門文章
PTT遊戲區 即時熱門文章
5
16