[FFmpeg-devel] [PATCH] Made minor changes to get the decklink avdevice code to build using Visual C++
Hendrik Leppkes
h.leppkes at gmail.com
Thu Apr 13 23:23:16 EEST 2017
On Thu, Apr 13, 2017 at 10:09 PM, Aaron Levinson <alevinsn at aracnet.com> wrote:
> On 4/13/2017 3:55 AM, Hendrik Leppkes wrote:
>>
>> On Thu, Apr 13, 2017 at 12:39 PM, Aaron Levinson <alevinsn at aracnet.com>
>> wrote:
>>>
>>> On 4/13/2017 12:36 AM, Hendrik Leppkes wrote:
>>> diff --git a/configure b/configure
>>> index a383bf2..9a06437 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -4843,8 +4843,6 @@ case $target_os in
>>> else
>>> target_os=mingw32
>>> fi
>>> - decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32
>>> -loleaut32"
>>> - decklink_indev_extralibs="$decklink_indev_extralibs -lole32
>>> -loleaut32"
>>> LIBTARGET=i386
>>> if enabled x86_64; then
>>> LIBTARGET="i386:x86-64"
>>> @@ -5946,6 +5944,19 @@ if ! disabled sdl2; then
>>> fi
>>> enabled sdl2 && enable sdl && add_cflags $sdl2_cflags && add_extralibs
>>> $sdl2_libs
>>>
>>> +if enabled decklink; then
>>> + case $target_os in
>>> + mingw32*|mingw64*)
>>> + decklink_outdev_extralibs="$decklink_outdev_extralibs
>>> -lole32 -loleaut32"
>>> + decklink_indev_extralibs="$decklink_indev_extralibs -lole32
>>> -loleaut32"
>>> + ;;
>>> + win32|win64)
>>> + decklink_outdev_extralibs="-lole32 -loleaut32"
>>> + decklink_indev_extralibs="-lole32 -loleaut32"
>>> + ;;
>>> + esac
>>> +fi
>>> +
>>
>>
>> Whats in the extralibs before this block that you need to clear out in
>> the msvc case?
>> Maybe that part should just be set conditionally so we can unify this,
>> and don't set something we need to strip out again after.
>>
>> - Hendrik
>
>
> decklink_outdev_extralibs and decklink_indev_extralibs are declared as
> follows earlier in configure:
>
> decklink_indev_extralibs="-lstdc++"
> decklink_outdev_extralibs="-lstdc++"
>
> This is done in the standard section where
> <library>_<indev|outdev>_<extralibs|deps> can be found.
>
> libstdc++ is needed when building the Decklink source files with gcc/g++
> because of, at a minimum, the use of STL in one of the .cpp files.
>
> For builds targeting Windows, -lole32 and -loleaut32 are also needed because
> of the use of COM. So, that explains why -lole32 and -loleaut32 are added
> for both mingw and Windows.
>
> Finally, when building with the Microsoft compiler (cl.exe), libstdc++ is
> not needed and actually can't be found. The C/C++ run-time is included by
> default in some form when building with cl.exe unless the -nodefaultlib
> linker option is used. So, that explains why it replaces the extralibs
> variables with just -lole32 and -loleaut32 for Windows builds. Note that
> win32 to specified as the target_os when an msvc build is done, and it may
> be the only case when target_os is set to win32 unless the user manually
> sets it as an option when invoking configure.
>
> -lole32 and -loleaut32 is likely relevant for both cygwin and the Intel
> compiler, but it should be a simple matter to add those later if anyone uses
> those for building. The elimination of -lstdc++ may also be relevant for
> the Intel compiler but probably only when using the Intel compiler on
> Windows.
>
> Anyway, I don't think an approach that moves -lstdc++ into the above if
> block is any better or worse than the patch in its current form, and the
> patch in its current form results in fewer changes to configure than a patch
> that moves -lstdc++ around.
>
You could add -lstdc++ to the msvc flag filter (ie.
msvc_common_flags), since its never needed, and may be added by more
things in the future, that would solve all of those neatly.
- Hendrik
More information about the ffmpeg-devel
mailing list