您的位置:首页 > 编程语言 > C语言/C++

VC++中使用DirectShow环境配置

2007-04-11 16:54 363 查看
1、将DirectX包安装在C盘根目录下:C:/DXSDK

2、将  C:/DXSDK/Include 、C:/DXSDK/Samples/C++/DirectShow/BaseClasses加入VC的include下

    (Tools->Options->Directories)

3、这个时候编译DirectShow的程序,可能会出现以下错误:

   --------------------Configuration: vdclient - Win32 Debug--------------------
Compiling...
CDXGraph.cpp
c:/dxsdk/include/strmif.h(1018) : error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE'
c:/dxsdk/include/strmif.h(1018) : fatal error C1004: unexpected end of file found
ClientSocket.cpp
c:/dxsdk/include/strmif.h(1018) : error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE'
c:/dxsdk/include/strmif.h(1018) : fatal error C1004: unexpected end of file found
ListeningSocket.cpp
c:/dxsdk/include/strmif.h(1018) : error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE'
c:/dxsdk/include/strmif.h(1018) : fatal error C1004: unexpected end of file found
vdclient.cpp
c:/dxsdk/include/strmif.h(1018) : error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE'
c:/dxsdk/include/strmif.h(1018) : fatal error C1004: unexpected end of file found
vdclientDlg.cpp
c:/dxsdk/include/strmif.h(1018) : error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE'
c:/dxsdk/include/strmif.h(1018) : fatal error C1004: unexpected end of file found
Generating Code...
Error executing cl.exe.
Creating browse info file...
BSCMAKE: error BK1506 : cannot open file './Debug/CDXGraph.sbr': No such file or directory
Error executing bscmake.exe.

vdclient.exe - 11 error(s), 0 warning(s)

4、解决的办法是,将#include "c:/dxsdk/include/strmif.h"加入VC的"stdafx.h"文件中

5、编译运行,如果成功的话,再把#include "c:/dxsdk/include/strmif.h"从"stdafx.h"中删除掉

6、OK!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vc++ file c include