error LNK2001: unresolved external symbol "int g_cTemplates" (?g_cTemplates@@3HA)(转)
Posted ~小小鸟~
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了error LNK2001: unresolved external symbol "int g_cTemplates" (?g_cTemplates@@3HA)(转)相关的知识,希望对你有一定的参考价值。
原文转自:http://blog.sina.com.cn/s/blog_639a2ad70101kpen.html
编译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" ([email protected]@[email protected]@A)strmbasd.lib(dllsetup.obj) : error LNK2001: unresolved external symbol "int g_cTemplates" ([email protected]@3HA)
则重新修改baseclasses project的内容
CFactoryTemplate g_Templates[1] = {
{ L"SystemClock", &CLSID_SystemClock, CSystemClock::CreateInstance} //修改后;
// {&CLSID_SystemClock, CSystemClock::CreateInstance} //原本的;
};
另外在baseclasses工程的 vc Project->Settings...->C/C++的 preprocessor definitions:加入FILTER_DLL
然后重新编译 strmbase.lib and strmbasd.lib 即可
以上是关于error LNK2001: unresolved external symbol "int g_cTemplates" (?g_cTemplates@@3HA)(转)的主要内容,如果未能解决你的问题,请参考以下文章
c语言 调试错误想不通 error LNK2001: unresolved external symbol
xxx.obj : error LNK2001: unresolved external symbol _printend
C++静态成员变量必须在类的定义之外进行声明 (error LNK2001: unresolved external symbol)
C 语言 error LNK2001: unresolved external symbol _fprint
link的时候出错error LNK2001: unresolved external symbol后面跟乱码
求高人指点!!!error LNK2001: unresolved external symbol "public: void __thiscall