bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: opencv3 incompatibility


From: Thomas Dickey
Subject: Re: opencv3 incompatibility
Date: Tue, 16 Apr 2019 16:53:37 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Apr 16, 2019 at 04:41:32PM +0200, Cacahuete Frito wrote:
> System information (version)
> 
>    - ncurses => 6 (ncurses-devel)
>    - OpenCV => 3.4 (opencv-devel)
>    - Operating System / Platform => openSUSE Tumbleweed
>    - Compiler => g++ 8 (gcc8-c++)
> 
> Detailed description
> 
> Incompatibility with opencv & ncurses.

It might help if you produced/sent the output of the preprocessor,
to show what's being mis-translated.

However - I pulled a temporary copy of opencv, to answer this.

The usual problem versus C++ is methods named "clear", etc.
opencv does that, but this is a little different.

> I was using opencv2 on Debian, and today I moved to openSUSE Tumbleweed,
> which has opencv3, and my first make failed with this error (see attached
> file).
> Steps to reproduce
> 
> If ncurses.h is included before opencv headers, build breaks.
> Workaround: #include <opencv2/opencv.hpp> before #include <ncurses.h>

> 
>       CXX     vision-artificial/tmp/main.s
> In file included from /usr/include/ncurses/ncurses.h:60,
>               from 
> /home/user/Desktop/code_c/vision-artificial/libalx//inc/libalx/extra/ncurses/common.hpp:21,
>               from 
> /home/user/Desktop/code_c/vision-artificial/src//main.cpp:16:
> /usr/include/opencv2/core/utility.hpp: In member function ‘void 
> cv::Mat::forEach_impl(const Functor&)’:
> /usr/include/ncurses/ncurses.h:1469:46: error: declaration of ‘const int 
> cv::_nc_LINES()’ has ‘extern’ and is initialized [-Werror]
> #define LINES       NCURSES_PUBLIC_VAR(LINES())
>                                       ^

ncurses defines LINES.  In the "normal" model, that would be an external
symbol...

> In file included from /usr/include/opencv2/core.hpp:3280,
>               from /usr/include/opencv2/core/core.hpp:48,
>               from 
> /home/user/Desktop/code_c/vision-artificial/inc/vision-artificial/image/iface.hpp:21,
>               from 
> /home/user/Desktop/code_c/vision-artificial/src//main.cpp:19:
> /usr/include/opencv2/core/utility.hpp:592:34: error: invalid pure specifier 
> (only ‘= 0’ is allowed) before ‘<’ token
> const int LINES = static_cast<int>(this->total() / this->size[this->dims - 
> 1]);

which should produce a compiler/linker error on this line.
It's _not_ const in any curses implementation.

However, SuSE configures the "thread" model, which makes ncurses
use #define for LINES.

Either way, I don't see how to improve things other than by fixing opencv.

Same comment here:
                                ^
> In file included from /usr/include/ncurses/ncurses.h:60,
>               from 
> /home/user/Desktop/code_c/vision-artificial/libalx//inc/libalx/extra/ncurses/common.hpp:21,
>               from 
> /home/user/Desktop/code_c/vision-artificial/src//main.cpp:16:
> /usr/include/opencv2/core/utility.hpp: In member function ‘virtual void 
> cv::Mat::forEach_impl(const 
> Functor&)::PixelOperationWrapper::operator()(const cv::Range&) const’:
> /usr/include/ncurses/ncurses.h:1467:45: error: declaration of ‘const int 
> cv::_nc_COLS()’ has ‘extern’ and is initialized [-Werror]
> #define COLS        NCURSES_PUBLIC_VAR(COLS())
>                                       ^
> In file included from /usr/include/opencv2/core.hpp:3280,
>               from /usr/include/opencv2/core/core.hpp:48,
>               from 
> /home/user/Desktop/code_c/vision-artificial/inc/vision-artificial/image/iface.hpp:21,
>               from 
> /home/user/Desktop/code_c/vision-artificial/src//main.cpp:19:
> /usr/include/opencv2/core/utility.hpp:605:33: error: invalid pure specifier 
> (only ‘= 0’ is allowed) before ‘->’ token
>       const int COLS = mat->size[DIMS - 1];
>                               ^~
> cc1plus: all warnings being treated as errors

:-)

-- 
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]