I'm struggling to build/link Vivek's Vcam / Capture Source Filter on Windows 10 with Visual Studio 2019 (Version 16.5.5) for x64 platforms.
(I have already built the BaseClasses project with no issues.)
These are the current building errors:
>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.
On C++ additional include directories I have "..\sdk7samples\baseclasses\;%(AdditionalIncludeDirectories)".
On Linker's additional library directories I have "..\sdk7samples\baseclasses\x64\Release\;%(AdditionalLibraryDirectories)".
On Linker's addidional dependencies I added strmbasd.lib (debug profile) / strmbase.lib (release profile).
Any suggestions? Thanks!
Try to disable "Conformance mode" in properties(From Yes(/permissive-)
to No
).
I can reproduce this issue and then get it compile after disable it.
This compiler option is set by default in Visual Studio 2017 version 15.5 and later, but it is not set by default in earlier versions.
According to the /permissive document:
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.