- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
vlc FTBFS with opencv-3.4.1 #10963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
OpenCV 3.x doesn't not support C compilation mode officially. There are still legacy C API calls (from OpenCV 1.x) but they should be compiled in C++ compilation mode. Good solution for C programs is FFI C bindings, but we don't have them (see some discussion here). |
Thanks, Alexander.
On 28/02/18 14:43, Alexander Alekhin wrote:
OpenCV 3.x doesn't not support C compilation mode officially. There are still legacy C API calls (from OpenCV 1.x) but
they should be compiled in C++ compilation mode.
Even if you succeeded to build code with C compiler (and avoid cvRound problem: #6585
<#6585>) it would lead to terrible behavior like #6221
<#6221> or silent crashes in case of raised C++ exceptions.
All new algorithms in OpenCV are written in C++, so there are no benefits to use OpenCV 3.x in C programs.
Ah, right. I was misled by the second sentence on opencv.org - "It has C++, C, Python and Java interfaces and supports
Windows, Linux, Mac OS, iOS and Android." I guess that doesn't actually conflict with what you say, but that's only
because it's a rather general statement :-)
Does 2.x support C compilation and, if not, what's the latest version that does, please?
… Good solution for C programs is FFI C bindings, but we don't have them (see some discussion here
<#10246 (comment)>).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#10963 (comment)>,
or mute the thread <https://github.com/notifications/unsubscribe-auth/AMWkxu9epbQCJsJoWbDm0ldufFyB57yzks5tZWUcgaJpZM4SWtnC>.
|
OpenCV 2.4.x has some chance to work properly, but we don't run "native C" tests anymore. |
This also breaks libfreenect, FWIW: https://koji.fedoraproject.org/koji/taskinfo?taskID=25506808 I'll look at whether libfreenect can/should be building for C++ not C. |
Trying to build the most recent mrpt, this issue persists...
Can anybody give some further suggestions ? |
After update to libfreenect-0.5.7 it built well |
Required for OpenCV 3.4.1 or later; strongly recommended for older versions >= OpenCV 2. See opencv/opencv#10963. This doesn't build yet -- the filter uses reserved C++ keywords (`class`) and it needs additional casts.
Raised on the ffmpeg-devel mailing list at http://ffmpeg.org/pipermail/ffmpeg-devel/2018-March/226872.html . |
Proposed fix by chris2553 worked for me. I'm 3.4.1-dev. |
On 27/03/18 11:23, Guo Wanqi wrote:
Proposed fix by chris2553 worked for me. I'm 3.4.1-dev.
ISTR that there was concern that, whilst my patch allowed the build to complete, the application may not work properly.
Why that may be the case is beyond my technical knowledge. C++ is a ragbag of bewildering traps to me :-)
Chris
… —
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#10963 (comment)>,
or mute the thread <https://github.com/notifications/unsubscribe-auth/AMWkxmM2SEPSUfT8AK802lYcN_XuqVRZks5tihM4gaJpZM4SWtnC>.
|
Actually I arrived here when hitting similar problems re-installing the darknet framework (our own version). It works just fine by returning to 3.4.0, which given the limited stuff darknet uses from OpenCV works, but to me that shows that we changed something drastically in the switch from 3.4.0 to 3.4.1-dev. Any way of reverting those changes and identifying how we can circumvent this? |
@StevenPuttemans: the immediate change was c020a7b ; that code is not C compatible, it assumes namespace support. So you can revert things to the status of 3.4.0 by just patching an But given what @alalek wrote in this comment, it seems unwise to just do that and go on pretending that OpenCV is C compatible when it really isn't. Which is why no-one's really suggesting we push that change upstream any more, and instead look at changing what downstreams expect of OpenCV. |
I beg to differ. Granted that OpenCV is first and foremost a C++ library, but why introduce a patch that breaks multiple downstream projects (in my case ffmpeg) just to prove a point? What is so hard about putting a This issue cost me 4 hours to debug, whereas it would have cost someone 10 seconds to write the guard in the first place, or just leave the legacy code alone. |
@AdamWill I have to agree with @NCBee here. OpenCV has always ensured backwards compatibility. Although not actively ensuring a working C-API they have been keeping it alive just because so many downstream projects tend to use this API. In my opinion it is a bad programming habbit to provide C++ - directives in C - headers. The convention is that if you provide a |
I also encountered this issue. Any chance of getting it resolved? |
This page: Seems to imply the .h files should be usable with a non-C++ compiler. |
Tutorials and docs are kind of notorious for not being kept entirely up to date. An explicit statement that this is not really the case any longer by one of the developers would seem to trump that. |
There is a know upstream ffmpeg compile error when enabling libopencv. It should compile opencv code in C++ mode but it is compiling in C mode. Disabling libopencv support while a fix is not provided either by upstream ffmpeg or by opencv repository package. References: ----------- http://trac.ffmpeg.org/ticket/7059 opencv/opencv#10963 https://bugs.archlinux.org/task/57811
opencv support was disabled[1] a long time ago because ffmpeg failed to build with it. opencv 3.x does not support C compilation mode[2] anymore, and ffmpeg uses only C. There is no ffmpeg interest[3] in compiling opencv in C++ mode, so opencv2 must be used here. References ---------- [1] https://aur.archlinux.org/cgit/aur.git/commit/?h=ffmpeg-full&id=5d72306579c20bc36ff7c6ff1005b168e3b263de [2] opencv/opencv#10963 [3] https://trac.ffmpeg.org/ticket/7059
opencv support was disabled[1] a long time ago because ffmpeg failed to build with it. opencv 3.x does not support C compilation mode[2] anymore, and ffmpeg uses only C. There is no ffmpeg interest[3] in compiling opencv in C++ mode, so opencv2 must be used here. References ---------- [1] https://aur.archlinux.org/cgit/aur.git/commit/?h=ffmpeg-full-git&id=f9d589fa30dddc8318fff742a87b7927566b2a9e [2] opencv/opencv#10963 [3] https://trac.ffmpeg.org/ticket/7059
Uh oh!
There was an error while loading. Please reload this page.
System information (version)
vlc-3.0.1 fails to build against opencv-3.4.1, because the C compiler produces and error at line 485 of /usr/include/opencv2/core/cvdef.h. The error message is:
This is because the C compiler is trying to compile C++ code.
Steps to reproduce
Proposed fix
The following patch to opencv allows the build of vlc to complete:
With the patched opencv installed, I have also built the frei0r-plugin-1.6.0, gstreamer-plugins-bad-1.12.4 and LiVES-2.8.7, all of which use opencv (although I don't know whether they failed against an unpatched version)
The text was updated successfully, but these errors were encountered: