问题描述
朋友,我是VC ++的新手,我从各种视频设备上阅读了名为Capture Live Video的文章.我下载了文章的源代码,并在编译后显示致命错误C1083之类的三个错误:无法打开包含文件:``dshow.h'':没有这样的文件或目录,所以我安装了Microsoft Platform SDK,并通过工具->选项->目录选项卡包含了目录,并且在编译源代码后出现了48个错误... .
e:\ documents and settings \ livevideo_demo \ capturevideo.h(115):错误C2143:语法错误:在``*''前缺少``;''
e:\ documents and settings \ livevideo_demo \ capturevideo.h(115):错误C2501:``ICaptureGraphBuilder2'':缺少存储类或类型说明符
e:\ documents and settings \\ livevideo_demo \ capturevideo.h(115):错误C2501:"m_pCapture":缺少存储类或类型说明符
e:\ documents and settings \ livevideo_demo \ capturevideo.h(123):错误C2143:语法错误:在``*''之前缺少``;''
e:\ documents and settings \ livevideo_demo \ capturevideo.h(123):错误C2501:``ICaptureGraphBuilder2'':缺少存储类或类型说明符
e:\ documents and settings \ livevideo_demo \ capturevideo.h(123):错误C2501:``m_pCaptureMoniker'':缺少存储类或类型说明符
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(33):错误C2065:``m_pCapture'':未声明的标识符
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(40):错误C2065:``m_pCaptureMoniker'':未声明的标识符
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(104):错误C2065:``CLSID_CaptureGraphBuilder2'':未声明的标识符
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(105):错误C2065:``IID_ICaptureGraphBuilder2'':未声明的标识符
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(315):错误C2065:``LONG_PTR'':未声明的标识符
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(315):错误C2059:语法错误:'')''
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(316):错误C2143:语法错误:缺少``;''在``{''
之前E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(342):错误C2227:``-> SetFiltergraph''的左侧必须指向class/struct/union
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(381):错误C2227:``-> RenderStream''的左侧必须指向class/struct/union
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(442):错误C2065:``wsprintfW_instead_use_StringCbPrintfW_or_StringCchPrintfW'':未声明的标识符
E:\ Documents and SettingsLiveVideo_demo \ CaptureVideo.cpp(442):错误C2065:``DWORD_PTR'':未声明的标识符
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(442):错误C2146:语法错误:标识符``pUnkGraph''之前缺少``)''E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(443):错误C2059:语法错误:'')''
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(509):错误C2227:``-> Release''的左侧必须指向class/struct/union
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(538):错误C2227:``-> Release''的左侧必须指向class/struct/union
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(713):错误C2227:``-> SetFiltergraph''的左侧必须指向class/struct/union
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(721):错误C2227:``-> RenderStream''的左侧必须指向class/struct/union
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(862):错误C2059:语法错误:'')''
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(863):错误C2143:语法错误:在``{''
之前缺少``;''E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(868):错误C2065:``EC_DEVICE_LOST'':未声明的标识符
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(868):错误C2051:大小写表达式不是常量
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(920):错误C2146:语法错误:标识符``pUnkGraph''之前缺少``)''
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(921):错误C2059:语法错误:'')''
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(964):错误C2065:``_vsntprintf_instead_use_StringCbVPrintf_or_StringCchVPrintf'':未声明的标识符
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(1001):错误C2227:``-> FindInterface''的左侧必须指向class/struct/union
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(1005):错误C2227:``-> FindInterface''的左侧必须指向class/struct/union
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(1067):错误C2227:``-> FindInterface''的左侧必须指向class/struct/union
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(1071):错误C2227:``-> FindInterface''的左侧必须指向class/struct/union
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(1145):错误C2227:``-> FindInterface''的左侧必须指向class/struct/union
E:\ Documents and Settings \ LiveVideo_demo \ CaptureVideo.cpp(1149):错误C2227:``-> FindInterface''的左侧必须指向class/struct/union
LiveVideo.cpp
e:\ documents and settings \ livevideo_demo \ capturevideo.h(115):错误C2143:语法错误:在``*''前缺少``;''
e:\ documents and settings \ livevideo_demo \ capturevideo.h(115):错误C2501:``ICaptureGraphBuilder2'':缺少存储类或类型说明符
e:\ documents and settings \ livevideo_demo \ capturevideo.h(115):错误C2501:``m_pCapture'':缺少存储类或类型说明符
e:\ documents and settings \ livevideo_demo \ capturevideo.h(123):错误C2143:语法错误:在``*''之前缺少``;''
e:\ documents and settings \ livevideo_demo \ capturevideo.h(123):错误C2501:``ICaptureGraphBuilder2'':缺少存储类或类型说明符
e:\ documents and settings \ livevideo_demo \ capturevideo.h(123):错误C2501:``m_pCaptureMoniker'':缺少存储类或类型说明符
LiveVideoDlg.cpp
e:\ documents and settings \ livevideo_demo \ capturevideo.h(115):错误C2143:语法错误:在``*''前缺少``;''
e:\ documents and settings \ livevideo_demo \ capturevideo.h(115):错误C2501:``ICaptureGraphBuilder2'':缺少存储类或类型说明符
e:\ documents and settings \ livevideo_demo \ capturevideo.h(115):错误C2501:``m_pCapture'':缺少存储类或类型说明符
e:\ documents and settings \ livevideo_demo \ capturevideo.h(123):错误C2143:语法错误:在``*''之前缺少``;''
e:\ documents and settings \ livevideo_demo \ capturevideo.h(123):错误C2501:``ICaptureGraphBuilder2'':缺少存储类或类型说明符
e:\ documents and settings \ livevideo_demo \ capturevideo.h(123):错误C2501:``m_pCaptureMoniker'':缺少存储类或类型说明符
正在生成代码...
执行cl.exe时出错.
LiveVideo.exe-48个错误,0个警告
请有人帮我找出解决方案....
Hi friends, I''m new to VC++.I read a article named Capture Live Video from various Video Devices.I downloaded the sorce code of the article and after compiling it show three errors like fatal error C1083: Cannot open include file: ''dshow.h'': No such file or directory.So I installed Microsoft platform SDK and included directory through tools-->options-->directory tab and after compiling the source code I am getting 48 error....
e:\documents and settings\livevideo_demo\capturevideo.h(115) : error C2143: syntax error : missing '';'' before ''*''
e:\documents and settings\livevideo_demo\capturevideo.h(115) : error C2501: ''ICaptureGraphBuilder2'' : missing storage-class or type specifiers
e:\documents and settings\\livevideo_demo\capturevideo.h(115) : error C2501: ''m_pCapture'' : missing storage-class or type specifiers
e:\documents and settings\livevideo_demo\capturevideo.h(123) : error C2143: syntax error : missing '';'' before ''*''
e:\documents and settings\livevideo_demo\capturevideo.h(123) : error C2501: ''ICaptureGraphBuilder2'' : missing storage-class or type specifiers
e:\documents and settings\livevideo_demo\capturevideo.h(123) : error C2501: ''m_pCaptureMoniker'' : missing storage-class or type specifiers
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(33) : error C2065: ''m_pCapture'' : undeclared identifier
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(40) : error C2065: ''m_pCaptureMoniker'' : undeclared identifier
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(104) : error C2065: ''CLSID_CaptureGraphBuilder2'' : undeclared identifier
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(105) : error C2065: ''IID_ICaptureGraphBuilder2'' : undeclared identifier
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(315) : error C2065: ''LONG_PTR'' : undeclared identifier
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(315) : error C2059: syntax error : '')''
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(316) : error C2143: syntax error : missing '';'' before ''{''
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(342) : error C2227: left of ''->SetFiltergraph'' must point to class/struct/union
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(381) : error C2227: left of ''->RenderStream'' must point to class/struct/union
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(442) : error C2065: ''wsprintfW_instead_use_StringCbPrintfW_or_StringCchPrintfW'' : undeclared identifier
E:\Documents and SettingsLiveVideo_demo\CaptureVideo.cpp(442) : error C2065: ''DWORD_PTR'' : undeclared identifier
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(442) : error C2146: syntax error : missing '')'' before identifier ''pUnkGraph''
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(443) : error C2059: syntax error : '')''
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(509) : error C2227: left of ''->Release'' must point to class/struct/union
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(538) : error C2227: left of ''->Release'' must point to class/struct/union
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(713) : error C2227: left of ''->SetFiltergraph'' must point to class/struct/union
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(721) : error C2227: left of ''->RenderStream'' must point to class/struct/union
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(862) : error C2059: syntax error : '')''
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(863) : error C2143: syntax error : missing '';'' before ''{''
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(868) : error C2065: ''EC_DEVICE_LOST'' : undeclared identifier
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(868) : error C2051: case expression not constant
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(920) : error C2146: syntax error : missing '')'' before identifier ''pUnkGraph''
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(921) : error C2059: syntax error : '')''
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(964) : error C2065: ''_vsntprintf_instead_use_StringCbVPrintf_or_StringCchVPrintf'' : undeclared identifier
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(1001) : error C2227: left of ''->FindInterface'' must point to class/struct/union
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(1005) : error C2227: left of ''->FindInterface'' must point to class/struct/union
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(1067) : error C2227: left of ''->FindInterface'' must point to class/struct/union
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(1071) : error C2227: left of ''->FindInterface'' must point to class/struct/union
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(1145) : error C2227: left of ''->FindInterface'' must point to class/struct/union
E:\Documents and Settings\LiveVideo_demo\CaptureVideo.cpp(1149) : error C2227: left of ''->FindInterface'' must point to class/struct/union
LiveVideo.cpp
e:\documents and settings\livevideo_demo\capturevideo.h(115) : error C2143: syntax error : missing '';'' before ''*''
e:\documents and settings\livevideo_demo\capturevideo.h(115) : error C2501: ''ICaptureGraphBuilder2'' : missing storage-class or type specifiers
e:\documents and settings\livevideo_demo\capturevideo.h(115) : error C2501: ''m_pCapture'' : missing storage-class or type specifiers
e:\documents and settings\livevideo_demo\capturevideo.h(123) : error C2143: syntax error : missing '';'' before ''*''
e:\documents and settings\livevideo_demo\capturevideo.h(123) : error C2501: ''ICaptureGraphBuilder2'' : missing storage-class or type specifiers
e:\documents and settings\livevideo_demo\capturevideo.h(123) : error C2501: ''m_pCaptureMoniker'' : missing storage-class or type specifiers
LiveVideoDlg.cpp
e:\documents and settings\livevideo_demo\capturevideo.h(115) : error C2143: syntax error : missing '';'' before ''*''
e:\documents and settings\livevideo_demo\capturevideo.h(115) : error C2501: ''ICaptureGraphBuilder2'' : missing storage-class or type specifiers
e:\documents and settings\livevideo_demo\capturevideo.h(115) : error C2501: ''m_pCapture'' : missing storage-class or type specifiers
e:\documents and settings\livevideo_demo\capturevideo.h(123) : error C2143: syntax error : missing '';'' before ''*''
e:\documents and settings\livevideo_demo\capturevideo.h(123) : error C2501: ''ICaptureGraphBuilder2'' : missing storage-class or type specifiers
e:\documents and settings\livevideo_demo\capturevideo.h(123) : error C2501: ''m_pCaptureMoniker'' : missing storage-class or type specifiers
Generating Code...
Error executing cl.exe.
LiveVideo.exe - 48 error(s), 0 warning(s)
Plz someone help me to findout solution....
推荐答案
这篇关于从各种视频设备捕获实时视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!