DirectShow虚拟相机示例不会使用链接器错误进行编译

时间:2016-07-25 17:16:14

标签: driver directshow

我正在尝试在VS2015中编译虚拟摄像机sample,但是有很多链接器错误:

strmbasd.lib(wxlist.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)
Filters.obj : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)
strmbasd.lib(wxdebug.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)
strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z)
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *,unsigned int)" (??3@YAXPAXI@Z)
strmbasd.lib(source.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *,unsigned int)" (??3@YAXPAXI@Z)
strmbasd.lib(wxlist.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *,unsigned int)" (??3@YAXPAXI@Z)
Filters.obj : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *,unsigned int)" (??3@YAXPAXI@Z)
strmbasd.lib(wxdebug.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *,unsigned int)" (??3@YAXPAXI@Z)
strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *,unsigned int)" (??3@YAXPAXI@Z)
strmbasd.lib(wxutil.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *,unsigned int)" (??3@YAXPAXI@Z)
Filters.obj : error LNK2019: unresolved external symbol "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) referenced in function "private: __thiscall CVCam::CVCam(struct IUnknown *,long *)" (??0CVCam@@AAE@PAUIUnknown@@PAJ@Z)
strmbasd.lib(wxdebug.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z)
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z)
strmbasd.lib(source.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z)
strmbasd.lib(combase.obj) : error LNK2001: unresolved external symbol _memcmp
strmbasd.lib(mtype.obj) : error LNK2001: unresolved external symbol _memcmp
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol _memcmp
Filters.obj : error LNK2001: unresolved external symbol _memcmp
strmbasd.lib(wxdebug.obj) : error LNK2001: unresolved external symbol _memcmp
strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol _memcmp
strmbasd.lib(amvideo.obj) : error LNK2001: unresolved external symbol _memcmp
Filters.obj : error LNK2019: unresolved external symbol _memset referenced in function "public: virtual long __thiscall CVCamStream::GetMediaType(int,class CMediaType *)" (?GetMediaType@CVCamStream@@UAEJHPAVCMediaType@@@Z)
strmbasd.lib(wxdebug.obj) : error LNK2001: unresolved external symbol _memset
strmbasd.lib(mtype.obj) : error LNK2001: unresolved external symbol _memset
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol _memset
Filters.obj : error LNK2019: unresolved external symbol __imp__rand referenced in function "public: virtual long __thiscall CVCamStream::FillBuffer(struct IMediaSample *)" (?FillBuffer@CVCamStream@@UAEJPAUIMediaSample@@@Z)
Filters.obj : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
strmbasd.lib(source.obj) : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12
strmbasd.lib(wxdebug.obj) : error LNK2019: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) referenced in function "public: __thiscall CDispBasic::~CDispBasic(void)" (??1CDispBasic@@QAE@XZ)
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z)
strmbasd.lib(source.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z)
strmbasd.lib(wxdebug.obj) : error LNK2019: unresolved external symbol ___report_rangecheckfailure referenced in function "public: __thiscall CDisp::CDisp(__int64,int)" (??0CDisp@@QAE@_JH@Z)
strmbasd.lib(wxdebug.obj) : error LNK2019: unresolved external symbol __imp__wcsrchr referenced in function "wchar_t * __cdecl wcsrchr(wchar_t *,wchar_t)" (?wcsrchr@@YAPA_WPA_W_W@Z)
strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol __imp__wcsrchr
strmbasd.lib(wxdebug.obj) : error LNK2019: unresolved external symbol __imp____stdio_common_vswprintf referenced in function __vsnwprintf_l
strmbasd.lib(dllsetup.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vswprintf
strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vswprintf
strmbasd.lib(wxutil.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vswprintf
strmbasd.lib(wxdebug.obj) : error LNK2019: unresolved external symbol __imp____stdio_common_vsprintf referenced in function __vsnprintf_l
strmbasd.lib(wxlist.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
strmbasd.lib(amvideo.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
strmbasd.lib(combase.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
strmbasd.lib(source.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
strmbasd.lib(wxdebug.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
strmbasd.lib(dllsetup.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
strmbasd.lib(wxutil.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
strmbasd.lib(amvideo.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
strmbasd.lib(mtype.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
strmbasd.lib(source.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
strmbasd.lib(wxdebug.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
strmbasd.lib(dllsetup.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
strmbasd.lib(wxutil.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
strmbasd.lib(source.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
strmbasd.lib(wxlist.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
strmbasd.lib(amvideo.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
strmbasd.lib(combase.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
strmbasd.lib(mtype.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
strmbasd.lib(wxdebug.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
strmbasd.lib(dllsetup.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
strmbasd.lib(wxutil.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
strmbasd.lib(source.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
strmbasd.lib(wxlist.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
strmbasd.lib(amvideo.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
strmbasd.lib(combase.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
strmbasd.lib(mtype.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
strmbasd.lib(wxdebug.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
strmbasd.lib(dllsetup.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
strmbasd.lib(wxutil.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
strmbasd.lib(source.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
strmbasd.lib(wxlist.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
strmbasd.lib(amvideo.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
strmbasd.lib(combase.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
strmbasd.lib(mtype.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
strmbasd.lib(wxdebug.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
strmbasd.lib(dllsetup.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
strmbasd.lib(wxutil.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
strmbasd.lib(wxdebug.obj) : error LNK2019: unresolved external symbol __alldiv referenced in function "public: __thiscall CDisp::CDisp(class CRefTime)" (??0CDisp@@QAE@VCRefTime@@@Z)
strmbasd.lib(wxdebug.obj) : error LNK2019: unresolved external symbol __allrem referenced in function "public: __thiscall CDisp::CDisp(class CRefTime)" (??0CDisp@@QAE@VCRefTime@@@Z)
strmbasd.lib(wxdebug.obj) : error LNK2019: unresolved external symbol __chkstk referenced in function "void __cdecl DbgBreakPoint(wchar_t const *,int,wchar_t const *,...)" (?DbgBreakPoint@@YAXPB_WH0ZZ)
strmbasd.lib(amvideo.obj) : error LNK2001: unresolved external symbol ___security_cookie
strmbasd.lib(mtype.obj) : error LNK2001: unresolved external symbol ___security_cookie
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol ___security_cookie
strmbasd.lib(source.obj) : error LNK2001: unresolved external symbol ___security_cookie
strmbasd.lib(wxdebug.obj) : error LNK2001: unresolved external symbol ___security_cookie
strmbasd.lib(dllsetup.obj) : error LNK2001: unresolved external symbol ___security_cookie
strmbasd.lib(dllentry.obj) : error LNK2001: unresolved external symbol ___security_cookie
strmbasd.lib(wxutil.obj) : error LNK2001: unresolved external symbol ___security_cookie
strmbasd.lib(wxdebug.obj) : error LNK2001: unresolved external symbol __fltused
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol __fltused
strmbasd.lib(dllentry.obj) : error LNK2019: unresolved external symbol ___security_init_cookie referenced in function _DllEntryPoint@12
strmbasd.lib(wxutil.obj) : error LNK2019: unresolved external symbol _memcpy referenced in function _AMGetWideString@8
strmbasd.lib(mtype.obj) : error LNK2001: unresolved external symbol _memcpy
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol _memcpy
strmbasd.lib(source.obj) : error LNK2001: unresolved external symbol _memcpy
strmbasd.lib(wxutil.obj) : error LNK2019: unresolved external symbol __RTC_UninitUse referenced in function "public: int __thiscall CAMMsgEvent::WaitMsg(unsigned long)" (?WaitMsg@CAMMsgEvent@@QAEHK@Z)
strmbasd.lib(amfilter.obj) : error LNK2001: unresolved external symbol __purecall
strmbasd.lib(source.obj) : error LNK2001: unresolved external symbol __purecall
strmbasd.lib(amfilter.obj) : error LNK2019: unresolved external symbol __allmul referenced in function "protected: virtual long __thiscall CMemAllocator::Alloc(void)" (?Alloc@CMemAllocator@@MAEJXZ)
strmbasd.lib(source.obj) : 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)

链接器命令行:

   /OUT:"C:\Users\Администратор.000\Documents\Visual Studio 2013\Projects\virtual-camera-demo\open-source-directshow-video-capture-demo-filter-master\vcam_vs_2010_demo_video_capture_project\Debug\vcam_vs_2010.ax" /MANIFEST /NXCOMPAT /PDB:"C:\Users\Администратор.000\Documents\Visual Studio 2013\Projects\virtual-camera-demo\open-source-directshow-video-capture-demo-filter-master\vcam_vs_2010_demo_video_capture_project\Debug\vcam_vs_2010.pdb" /DYNAMICBASE "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\Debug\strmbasd.lib" "strmiids.lib" "winmm.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEF:"Filters.def" /IMPLIB:"C:\Users\Администратор.000\Documents\Visual Studio 2013\Projects\virtual-camera-demo\open-source-directshow-video-capture-demo-filter-master\vcam_vs_2010_demo_video_capture_project\Debug\vcam_vs_2010.lib" /DEBUG /DLL /MACHINE:X86 /INCREMENTAL /PGD:"C:\Users\Администратор.000\Documents\Visual Studio 2013\Projects\virtual-camera-demo\open-source-directshow-video-capture-demo-filter-master\vcam_vs_2010_demo_video_capture_project\Debug\vcam_vs_2010.pgd" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"Debug\vcam_vs_2010.ax.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /NODEFAULTLIB /TLBID:1 

我编译了strmbasd.lib,包含了所有必需的库,从baseclasses项目检查了unicode字符集和编译器设置,尝试下载编译过的strmbasd.lib,但我无法理解有什么问题。如何使这个示例编译成功?

2 个答案:

答案 0 :(得分:1)

我无法让directshow vcam示例在Windows 10 w \ VS 2013或VS 2015上工作,我花了无数个小时。

我能够在大约30分钟内在Win7 x86虚拟机中使用它。我可能会在某些时候通过并重新验证这些

步骤1:创建Windows 7虚拟机x86

第2步:获取sdk

* [https://www.microsoft.com/en-us/download/details.aspx?id=8442][1]

第3步:获取2010年样本

* https://www.microsoft.com/en-us/download/details.aspx?id=6812
* installs files program files\microsoft DirectX SDK (June 2010)
* this step is probably not needed.

第4步:dl visual studio 2013

* [https://go.microsoft.com/fwlink/?LinkId=517284][1]

第5步:安装git

* install git
* mkdir projects
* git clone https://github.com/johnmaccormick/MultiCam
* cd MultiCam

第6步:

* import these \baseclasses into a project c:\projects\baseclasses
* 
    * C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses
    * I think these build first time, didn't change anything that I can remember

第7步:

* open multicam project
* vcam project properties-->library directories
* add C:\Program Files\Microsoft SDKs\Windows\v7.1\lib
* add c:\projects\baseclasses\debug
* compile win32

答案 1 :(得分:1)

我在尝试使用Visual Studio 2015制作音频渲染器过滤器时偶然发现了同样的事情。我设法通过添加所需的库和来自crt的一些奇怪的东西来链接(使用/NODEFAULTLIBS标志)运行时源(确切地说initializers.cpp)。您可以查看https://github.com/rubu/VirtualAudioRenderer