在 Windows 10 上构建 Vivek 的虚拟相机时出现链接器错误?

Linker errors in building Vivek's Virtual Camera on Windows 10?

我正在尝试在 Windows 10 上构建 Vivek's Virtual Camera
为此,我需要 Win7Samples/multimedia/directshow/baseclasses

我已经下载 baseclasses 并使用 Visual Studio 2019 构建它。
现在我准备构建虚拟相机滤镜。我遵循了几个必要的步骤

  1. git clone https://github.com/roman380/tmhare.mvps.org-vcam
  2. cd tmhare.mvps.org-vcam\Filters
  3. 然后我尝试在 Visual Studio 2019 年打开 Filters.dsp,它要求我做 one-way upgrade
  4. Additional Include Directories
    中添加了 C:\Users\alokm\tmp\Windows-classic-samples\Samples\Win7Samples\multimedia\directshow\baseclasses
  5. 已将 C:\Users\alokm\tmp\Windows-classic-samples\Samples\Win7Samples\multimedia\directshow\baseclasses\Debug 添加到 Addition Library Directories
  6. 完成所有这些步骤后,我尝试通过点击 Build >> Build Solution
    来构建 但是我收到很多链接器错误。

文本格式错误:

Severity    Code    Description Project File    Line    Suppression State
Error   LNK2001 unresolved external symbol _memcmp  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(combase.obj)   1   
Error   LNK2001 unresolved external symbol _memcmp  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(mtype.obj) 1   
Error   LNK2001 unresolved external symbol _memcmp  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(amfilter.obj)  1   
Error   LNK2001 unresolved external symbol _memcmp  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\Filters.obj 1   
Error   LNK2001 unresolved external symbol _memcmp  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(dllentry.obj)  1   
Error   LNK2001 unresolved external symbol _memcmp  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(wxdebug.obj)   1   
Error   LNK2001 unresolved external symbol _memcmp  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(amvideo.obj)   1   
Error   LNK2019 unresolved external symbol _memset referenced in function "public: virtual long __thiscall CVCamStream::GetMediaType(int,class CMediaType *)" (?GetMediaType@CVCamStream@@UAEJHPAVCMediaType@@@Z)   Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\Filters.obj 1   
Error   LNK2001 unresolved external symbol _memset  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(wxdebug.obj)   1   
Error   LNK2001 unresolved external symbol _memset  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(mtype.obj) 1   
Error   LNK2001 unresolved external symbol _memset  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(amfilter.obj)  1   
Error   LNK2019 unresolved external symbol __imp__rand referenced in function "public: virtual long __thiscall CVCamStream::FillBuffer(struct IMediaSample *)" (?FillBuffer@CVCamStream@@UAEJPAUIMediaSample@@@Z)   Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\Filters.obj 1   
Error   LNK2001 unresolved external symbol ___CxxFrameHandler3  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(mtype.obj) 1   
Error   LNK2001 unresolved external symbol ___CxxFrameHandler3  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(amfilter.obj)  1   
Error   LNK2001 unresolved external symbol ___CxxFrameHandler3  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(source.obj)    1   
Error   LNK2001 unresolved external symbol ___CxxFrameHandler3  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(wxlist.obj)    1   
Error   LNK2001 unresolved external symbol ___CxxFrameHandler3  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\Filters.obj 1   
Error   LNK2001 unresolved external symbol ___CxxFrameHandler3  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(wxdebug.obj)   1   
Error   LNK2001 unresolved external symbol ___CxxFrameHandler3  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(wxutil.obj)    1   
Error   LNK2001 unresolved external symbol ___CxxFrameHandler3  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(combase.obj)   1   
Error   LNK2019 unresolved external symbol _wcsrchr referenced in function "wchar_t * __cdecl wcsrchr(wchar_t *,wchar_t)" (?wcsrchr@@YAPA_WPA_W_W@Z)    Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(dllentry.obj)  1   
Error   LNK2001 unresolved external symbol _wcsrchr Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(wxdebug.obj)   1   
Error   LNK2019 unresolved external symbol __imp____stdio_common_vswprintf referenced in function __vsnwprintf_l    Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(dllentry.obj)  1   
Error   LNK2001 unresolved external symbol __imp____stdio_common_vswprintf  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(wxdebug.obj)   1   
Error   LNK2001 unresolved external symbol __imp____stdio_common_vswprintf  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(dllsetup.obj)  1   
Error   LNK2001 unresolved external symbol __imp____stdio_common_vswprintf  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(wxutil.obj)    1   
Error   LNK2019 unresolved external symbol __imp____stdio_common_vsprintf referenced in function __vsnprintf_l  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(wxdebug.obj)   1   
Error   LNK2019 unresolved external symbol _memcpy referenced in function _AMGetWideString@8    Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(wxutil.obj)    1   
Error   LNK2001 unresolved external symbol _memcpy  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(mtype.obj) 1   
Error   LNK2001 unresolved external symbol _memcpy  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(amfilter.obj)  1   
Error   LNK2001 unresolved external symbol _memcpy  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(source.obj)    1   
Error   LNK2001 unresolved external symbol __purecall   Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(amfilter.obj)  1   
Error   LNK2001 unresolved external symbol __purecall   Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(source.obj)    1   
Error   LNK2019 unresolved external symbol __imp___wtoi referenced in function "public: virtual long __stdcall CSource::FindPin(wchar_t const *,struct IPin * *)" (?FindPin@CSource@@UAGJPB_WPAPAUIPin@@@Z) Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\strmbasd.lib(source.obj)    1   
Error   LNK2019 unresolved external symbol __CrtDbgReport referenced in function __CRT_RTC_INIT Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(init.obj)   1   
Error   LNK2019 unresolved external symbol __CrtDbgReportW referenced in function __CRT_RTC_INITW   Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(init.obj)   1   
Error   LNK2019 unresolved external symbol __callnewh referenced in function "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(new_scalar.obj) 1   
Error   LNK2019 unresolved external symbol _malloc referenced in function "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)    Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(new_scalar.obj) 1   
Error   LNK2019 unresolved external symbol _strcpy_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPAXPBD@Z) Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(error.obj)  1   
Error   LNK2019 unresolved external symbol _strcat_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPAXPBD@Z) Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(error.obj)  1   
Error   LNK2019 unresolved external symbol ___stdio_common_vsprintf_s referenced in function __vsprintf_s_l Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(error.obj)  1   
Error   LNK2019 unresolved external symbol ___std_exception_copy referenced in function "public: __thiscall std::exception::exception(class std::exception const &)" (??0exception@std@@QAE@ABV01@@Z)   Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(throw_bad_alloc.obj)    1   
Error   LNK2019 unresolved external symbol ___std_exception_destroy referenced in function "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ) Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(throw_bad_alloc.obj)    1   
Error   LNK2019 unresolved external symbol __CxxThrowException@8 referenced in function "void __cdecl __scrt_throw_std_bad_alloc(void)" (?__scrt_throw_std_bad_alloc@@YAXXZ)    Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(throw_bad_alloc.obj)    1   
Error   LNK2019 unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(delete_scalar.obj)  1   
Error   LNK2019 unresolved external symbol __wmakepath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z)    Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(pdblkup.obj)    1   
Error   LNK2019 unresolved external symbol __wsplitpath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z)   Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(pdblkup.obj)    1   
Error   LNK2019 unresolved external symbol _wcscpy_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z)    Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(pdblkup.obj)    1   
Error   LNK2019 unresolved external symbol ___vcrt_GetModuleFileNameW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(pdblkup.obj)    1   
Error   LNK2019 unresolved external symbol ___vcrt_GetModuleHandleW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)    Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(pdblkup.obj)    1   
Error   LNK2019 unresolved external symbol ___vcrt_LoadLibraryExW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ)  Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(pdblkup.obj)    1   
Error   LNK2019 unresolved external symbol _terminate referenced in function __except_handler4_noexcept Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(chandler4_noexcept.obj) 1   
Error   LNK2019 unresolved external symbol ___current_exception referenced in function __except_handler4_noexcept   Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(chandler4_noexcept.obj) 1   
Error   LNK2019 unresolved external symbol ___current_exception_context referenced in function __except_handler4_noexcept   Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(chandler4_noexcept.obj) 1   
Error   LNK2019 unresolved external symbol __except_handler4_common referenced in function __except_handler4    Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Filters\MSVCRTD.lib(chandler4gs.obj)    1   
Error   LNK1120 31 unresolved externals Filters C:\Users\alokm\tmp\tmhare.mvps.org-vcam\Bin\VCamD.ax    1   

我哪里错了?如何让它工作?

构建项目的问题来自于:

  1. 项目源代码依赖于 DirectShow BaseClasses,它不再是 Windows SDK
  2. 的一部分
  3. 该项目有太多偏离默认设置的设置;当前 Visual Studio 成为问题

我更新了 github repository 并更改了项目设置以构建项目(Visual Studio 2019 Communitty)和 运行:恢复了大部分 C++ 项目设置和 DirectShow BaseClasses在 github.

的构建配置中使用

在那里查看 README.md,按照构建步骤(需要先提取 Windows SDK 示例,然后在那里构建 DirectShow 的东西),注册 DLL (regsvr32),最后您将拥有生成带有随机数据的视频的过滤器: