Building/linking Vivek 的 Vcam / Capture Source Filter 错误

Building/linking errors with the Vivek's Vcam / Capture Source Filtet

我正在努力 build/link Vivek's Vcam / Capture Source Filter 在 Windows 10 上使用 Visual Studio 2019(版本 16.5.5)用于 x64 平台。

(我已经毫无问题地构建了 BaseClasses 项目。)

这些是当前的构建错误:

>Dll.cpp
>(folder)\vsprojects\sdk7samples\baseclasses\transip.h(214,55): error C4596: 'Copy': illegal qualified name in member declaration
>(folder)\vsprojects\sdk7samples\baseclasses\videoctl.h(54,44): error C2385: ambiguous access of '{dtor}'
>(folder)\vsprojects\sdk7samples\baseclasses\videoctl.h(54,44): message : could be the '{dtor}' in base 'IDirectDraw'
>(folder)\vsprojects\sdk7samples\baseclasses\videoctl.h(54,44): message : or could be the '{dtor}' in base 'CUnknown'
>(folder)\vsprojects\sdk7samples\baseclasses\videoctl.h(54,47): error C3254: 'CAggDirectDraw': class contains explicit override '{dtor}' but does not derive from an interface that contains the function declaration
>(folder)\vsprojects\sdk7samples\baseclasses\videoctl.h(54,47): error C3244: 'CAggDirectDraw::~CAggDirectDraw(void)': this method was introduced by '<Unknown>' not by 'IDirectDraw'
>(folder)\references\vcam\Filters\Dll.cpp(48,5): error C2440: 'initializing': cannot convert from 'const wchar_t [7]' to 'LPWSTR'
>(folder)\references\vcam\Filters\Dll.cpp(48,5): message : Conversion from string literal loses const qualifier (see /Zc:strictStrings)
>Filters.cpp
>(folder)\vsprojects\sdk7samples\baseclasses\transip.h(214,55): error C4596: 'Copy': illegal qualified name in member declaration
>(folder)\vsprojects\sdk7samples\baseclasses\videoctl.h(54,44): error C2385: ambiguous access of '{dtor}'
>(folder)\vsprojects\sdk7samples\baseclasses\videoctl.h(54,44): message : could be the '{dtor}' in base 'IDirectDraw'
>(folder)\vsprojects\sdk7samples\baseclasses\videoctl.h(54,44): message : or could be the '{dtor}' in base 'CUnknown'
>(folder)\vsprojects\sdk7samples\baseclasses\videoctl.h(54,47): error C3254: 'CAggDirectDraw': class contains explicit override '{dtor}' but does not derive from an interface that contains the function declaration
>(folder)\vsprojects\sdk7samples\baseclasses\videoctl.h(54,47): error C3244: 'CAggDirectDraw::~CAggDirectDraw(void)': this method was introduced by '<Unknown>' not by 'IDirectDraw'
>Done building project "vcam.vcxproj" -- FAILED.

在 C++ 上,附加包含目录我有“..\sdk7samples\baseclasses\;%(AdditionalIncludeDirectories)”。

在链接器的附加库目录中,我有“..\sdk7samples\baseclasses\x64\Release\;%(AdditionalLibraryDirectories)”。

在链接器的附加依赖项上,我添加了 strmbasd.lib(调试配置文件)/strmbase.lib(发布配置文件)。

有什么建议吗?谢谢!

尝试在属性中禁用 "Conformance mode"(从 Yes(/permissive-)No)。

我可以重现这个问题,然后在禁用它之后编译它。

此编译器选项在Visual Studio2017版本15.5及以后默认设置,但在早期版本中默认不设置。

根据 /permissive 文档:

By default, the /permissive- option is set in new projects created by Visual Studio 2017 version 15.5 and later versions. It's not set by default in earlier versions. When the option is set, the compiler generates diagnostic errors or warnings when non-standard language constructs are detected in your code, including some common bugs in pre-C++11 code.

...Older versions of the SDK may fail to compile under /permissive- for various source code conformance reasons.