有关direct show 编译问题汇总(二)

来源:互联网 发布:防辐射眼镜 知乎 编辑:程序博客网 时间:2024/06/11 21:13

5.源码文件里添加头文件
#include <streams.h>
编译,假如报错的话,见下:
编译directshow问题的解决
use vs2005 compiler directshow baseclasses has something error
1.ctlutil.h
modify as below:
  //operator=(LONG); 
COARefTime& operator=(LONG);

2.winutil.cpp
modify as below:
UINT Count; 
for (Count = 0;Count < Result;Count++) { 

3.outputq.cpp
modify as below:
long iDone; 
for (iDone = 0; 

4.wxdebug.cpp
modify as below:
//static g_dwLastRefresh = 0;
static DWORD g_dwLastRefresh = 0;

如果編譯程式出現
error LNK2019: 無法解析的外部符號 "int __stdcall lstrcmpWInternal
error LNK2019: 無法解析的外部符號 "int __cdecl wsprintfWInternal
error LNK2019: 無法解析的外部符號 "int __stdcall lstrcmpiWInternal
之類的錯誤
這是baseclasses編譯時有個設定要變更
就是project屬性->組態屬性->C/C++->語言之下的 "將wchar_t當作Built-in型別" 設為false
就可以解決上述link error的問題

如果編譯程式link strmbase.lib or strmbasd.lib出現以下的error
strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol "class CFactoryTemplate * g_Templates" (?g_Templates@@3PAVCFactoryTemplate@@A)strmbasd.lib(dllsetup.obj) : error LNK2001: unresolved external symbol "int g_cTemplates" (?g_cTemplates@@3HA)
則重新修改baseclasses project的檔案內容
CFactoryTemplate g_Templates[1] = { 
{      L"SystemClock", &CLSID_SystemClock, CSystemClock::CreateInstance}  //修改後; 
//    {&CLSID_SystemClock, CSystemClock::CreateInstance}   //原本的; 
}; 
另外在vc Project->Settings...->C/C++的 preprocessor definitions:加入FILTER_DLL
然後重新編譯strmbase.lib and strmbasd.lib即可
0 0
原创粉丝点击