2011년 7월 8일 금요일

DirectShow 링크 에러관련 체크

에러 메시지: error LNK2019: unresolved external symbol "public: __thiscall CTransInPlaceFilter::CTransInPlaceFilter(wchar_t const *,struct IUnknown *,struct _GUID const &,long *,bool)" (??0CTransInPlaceFilter@@QAE@PB_WPAUIUnknown@@ABU_GUID@@PAJ_N@Z) referenced in function "public: __thiscall CVideoFrameFilter::CVideoFrameFilter(wchar_t *,struct IUnknown *,long *)" (??0CVideoFrameFilter@@QAE@PA_WPAUIUnknown@@PAJ@Z)
=> 위와같은 링크에러시 BaseClasses와 필터 프로젝트의 속성에서 Character Set(예: Use Multi-Byte Character Set)이 서로 맞는지 확인.

에러 메시지: error LNK2001: unresolved external symbol "class CFactoryTemplate * g_Templates" (?g_Templates@@3PAVCFactoryTemplate@@A)
=> 위와같은 링크에러 발생시 아래 코드 추가 (출처 : http://www.vbforums.com/archive/index.php/t-296274.html)

extern "C"
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());

return AfxDllGetClassObject(rclsid, riid, ppv);
}

extern "C"
STDAPI DllCanUnloadNow(void)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());

return AfxDllCanUnloadNow();
}

에러 메시지: error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function "void __stdcall DbgInitialise(struct HINSTANCE__ *)" (?DbgInitialise@@YGXPAUHINSTANCE__@@@Z)
=> 프로젝트 속성 additional dependencies에 winmm.lib 추가

에러 메시지: regsvr32 로 dll 등록시 "g_hInst != 0 ...baseclasses\dllsetup.cpp" 메시지 박스 뜰때
=> 아래 코드추가 (출처 : http://social.msdn.microsoft.com/forums/en-US/windowsdirectshowdevelopment/thread/15323770-9485-4284-8487-017845f592c0/)

extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);

BOOL WINAPI DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID lpReserved)

{
return DllEntryPoint(reinterpret_cast<HINSTANCE>(hDllHandle), dwReason, lpReserved);
}

댓글 없음:

댓글 쓰기