回 帖 发 新 帖 刷新版面

主题:[讨论]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个回复)

21 楼


不对,我开始以为是这样,可是不是,删除了还有这个错

22 楼



          楼主:    你可有DIRECTSHOW。。。下的AMCap实例?

23 楼

不大清楚。

24 楼

你把整个VC项目打包发到我邮箱里吧,我看看
pengzhao218@126.com

25 楼

出现新的错误
Generating Code...
Linking...
CaptureVideo.obj : error LNK2001: unresolved external symbol _IID_ISampleGrabberCB
CaptureVideo.obj : error LNK2001: unresolved external symbol _CLSID_SampleGrabber
CaptureVideo.obj : error LNK2001: unresolved external symbol _CLSID_CaptureGraphBuilder2
CaptureVideo.obj : error LNK2001: unresolved external symbol _IID_ICaptureGraphBuilder2
Debug/test.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.


难到还少了 库文件?

emmett 兄,已发到你的信箱,谢谢你啦。

26 楼


我已整个的搞定了,兄弟们!!!

27 楼

是嘛?那恭喜你了。麻烦你把文件打包一下发到我的信箱去好吗 ? 

28 楼

erliqq 兄,搞定了也不说说方法?这样不大好吧。

29 楼

我也搞定了,有点奇怪,前几天编译了一下,又可以了。谢谢大家的关注。

30 楼

兄弟我正在做这个的毕业设计,能不能共享一下改错过程?我参考同样的代码,错误一大堆啊

烦把东西发到我邮箱:mmmhui@126.com
谢谢啊

我来回复

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