[FFmpeg-devel] OpenCV filter should be built as C++, and C builds fail since OpenCV 3.4.1

Derek Buitenhuis derek.buitenhuis at gmail.com
Mon Mar 19 22:49:43 EET 2018


On 3/19/2018 5:01 PM, Jan Ekström wrote:
> On Mon, Mar 19, 2018 at 6:28 PM, wm4 <nfxjfg at googlemail.com> wrote:
>> On Mon, 19 Mar 2018 09:35:22 -0400
>> Jeff Cook <jeff.cook at strongstrata.com> wrote:
>>
>>> Hello,
>>>
>>> Please see the bug report at https://github.com/opencv/opencv/issues/10963 , which discusses OpenCV's failure to build as pure C since upstream version 3.4.1, and also discusses how all modules that use OpenCV 2 or later should be compiled as C++ to avoid esoteric issues and serious breakages.
>>>
>>> There is a large amount of discussion there that I don't want to needlessly duplicate and/or badly summarize here, but the high-level overview is that it seems that ffmpeg will need to convert avfilter/vf_opencv.c to build as C++ if the OpenCV filter is going to continue to work. The current situation is affecting many prominent projects like VLC.
>>
>> FFmpeg is a C project, and due to missing features in C++ (initializers)
>> it's very awkward to build things in C++ mode. Can't OpenCV just fix
>> their stuff.
>>
> 
> https://github.com/opencv/opencv/issues/8438#issuecomment-288638915
> 
> tl;dr
> 
> They're breaking C compatibility knowingly. If and only if we want to
> keep whatever features we get by linking against OpenCV, then the
> correct mode of operation is to make that specific file compile as C++
> and export the relevant C end points. Or maybe just link with the C++
> side of things; whatever was done with libutvideo back in the day?

As the author of that...

libutvideo was handled 100% incorrectly. We hardcoded libstdc++ as a
dependency, but the proper solution was to link with CXX instead of CC.

- Derek


More information about the ffmpeg-devel mailing list