回 帖 发 新 帖 刷新版面

主题:[讨论]Visual C++编程实现摄像头视频捕捉

用 vc 编程实现摄像头视频捕捉 。我找了一篇文章,地址如下

http://www.programfan.com/article/showarticle.asp?id=2868

我按文章的要求去做,装了DirectX9 SDK ,并导入了Strmiids.lib Quartz.lib 这两个库,在 xp vc 下运行,出现这样的错误


--------------------Configuration: test - Win32 Debug--------------------
Compiling...
CaptureVideo.cpp
c:\test\capturevideo.h(36) : error C2143: syntax error : missing ';' before '*'
c:\test\capturevideo.h(36) : error C2501: 'ICaptureGraphBuilder2' : missing storage-class or type specifiers
c:\test\capturevideo.h(36) : error C2501: 'm_pCapture' : missing storage-class or type specifiers
c:\test\capturevideo.h(40) : error C2065: 'ISampleGrabber' : undeclared identifier
c:\test\capturevideo.h(40) : error C2955: 'CComPtr' : use of class template requires template argument list
        c:\program files\microsoft visual studio\vc98\atl\include\atlbase.h(563) : see declaration of 'CComPtr'
c:\test\capturevideo.h(40) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Error executing cl.exe.

test.exe - 6 error(s), 0 warning(s)


用DirectX9 SDK  编程还要什么设置吗?导入Strmiids.lib Quartz.lib ,是project->
setting->Link->Object/library moudules 中加入的,在Tools->Directories->Library files 中也加入了相关的目录,编译的程序是 MFC AppWizard(exe) 程序,不是向导中的DirectX 9 AppWizard 生成的程序。

谢谢指导。

回复列表 (共31个回复)

31 楼


各位仁兄,我出现的也是这个错误,还请你们各位有源码的给我发一份了,小弟在此谢了哈!我的邮箱是:275611024@qq.com

我的错误是:
capturevideo.h(40) : error C2065: 'ISampleGrabber' : undeclared identifier
capturevideo.h(40) : error C2955: 'CComPtr' : use of class template requires template argument list
        d:\program files\microsoft visual studio\vc98\atl\include\atlbase.h(563) : see declaration of 'CComPtr'
\capturevideo.h(40) : fatal error C1903: unable to recover from previous error(s); stopping compilation

我来回复

您尚未登录,请登录后再回复。点此登录或注册