Opencv ZLIB generation issue

What must be filled in the ZLIB field to get the generation going?

I am using a linux PC, I have ZLIB installed already, got the below by running dpkg -L zlib1g-dev

image

Thanks,
G Kowshik

It’s not same context but may be you can try this

please, give information as text, no useless screenshots, ty.

then, weren’t you trying to cross-compile something ? you probably cannot use your (host) system libs for this. in that case, rather use the BUILD_zlib flag, so it will also cross-compile 3rdparty libs

Hi,

I was able to get the generation done by making changes as below

I then went ahead to build/ folder and ran “make” command and I am getting the following errors

make -s
[  0%] Built target opencv_dnn_plugins
[  0%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/thread.c.obj
[  0%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/bio.c.obj
[  1%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/cio.c.obj
[  1%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/dwt.c.obj
[  1%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/event.c.obj
[  2%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/image.c.obj
[  2%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/invert.c.obj
[  2%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/j2k.c.obj
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c: In function 'opj_j2k_dump_tile_info':
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11005:42: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11005 |         fprintf(out_stream, "\t\t csty=%#x\n", l_default_tile->csty);
      |                                        ~~^     ~~~~~~~~~~~~~~~~~~~~
      |                                          |                   |
      |                                          unsigned int        OPJ_UINT32 {aka long unsigned int}
      |                                        %#lx
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11007:46: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11007 |         fprintf(out_stream, "\t\t numlayers=%d\n", l_default_tile->numlayers);
      |                                             ~^     ~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                              |                   |
      |                                              int                 OPJ_UINT32 {aka long unsigned int}
      |                                             %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11008:40: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11008 |         fprintf(out_stream, "\t\t mct=%x\n", l_default_tile->mct);
      |                                       ~^     ~~~~~~~~~~~~~~~~~~~
      |                                        |                   |
      |                                        unsigned int        OPJ_UINT32 {aka long unsigned int}
      |                                       %lx
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11016:45: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_INT32' {aka 'long int'} [-Wformat=]
11016 |             fprintf(out_stream, "\t\t comp %d {\n", compno);
      |                                            ~^       ~~~~~~
      |                                             |       |
      |                                             int     OPJ_INT32 {aka long int}
      |                                            %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11017:48: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11017 |             fprintf(out_stream, "\t\t\t csty=%#x\n", l_tccp->csty);
      |                                              ~~^     ~~~~~~~~~~~~
      |                                                |           |
      |                                                |           OPJ_UINT32 {aka long unsigned int}
      |                                                unsigned int
      |                                              %#lx
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11018:57: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11018 |             fprintf(out_stream, "\t\t\t numresolutions=%d\n", l_tccp->numresolutions);
      |                                                        ~^     ~~~~~~~~~~~~~~~~~~~~~~
      |                                                         |           |
      |                                                         int         OPJ_UINT32 {aka long unsigned int}
      |                                                        %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11019:50: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11019 |             fprintf(out_stream, "\t\t\t cblkw=2^%d\n", l_tccp->cblkw);
      |                                                 ~^     ~~~~~~~~~~~~~
      |                                                  |           |
      |                                                  int         OPJ_UINT32 {aka long unsigned int}
      |                                                 %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11020:50: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11020 |             fprintf(out_stream, "\t\t\t cblkh=2^%d\n", l_tccp->cblkh);
      |                                                 ~^     ~~~~~~~~~~~~~
      |                                                  |           |
      |                                                  int         OPJ_UINT32 {aka long unsigned int}
      |                                                 %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11021:51: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11021 |             fprintf(out_stream, "\t\t\t cblksty=%#x\n", l_tccp->cblksty);
      |                                                 ~~^     ~~~~~~~~~~~~~~~
      |                                                   |           |
      |                                                   |           OPJ_UINT32 {aka long unsigned int}
      |                                                   unsigned int
      |                                                 %#lx
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11022:49: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11022 |             fprintf(out_stream, "\t\t\t qmfbid=%d\n", l_tccp->qmfbid);
      |                                                ~^     ~~~~~~~~~~~~~~
      |                                                 |           |
      |                                                 int         OPJ_UINT32 {aka long unsigned int}
      |                                                %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11026:40: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11026 |                 fprintf(out_stream, "(%d,%d) ", l_tccp->prcw[resno], l_tccp->prch[resno]);
      |                                       ~^        ~~~~~~~~~~~~~~~~~~~
      |                                        |                    |
      |                                        int                  OPJ_UINT32 {aka long unsigned int}
      |                                       %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11026:43: warning: format '%d' expects argument of type 'int', but argument 4 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11026 |                 fprintf(out_stream, "(%d,%d) ", l_tccp->prcw[resno], l_tccp->prch[resno]);
      |                                          ~^                          ~~~~~~~~~~~~~~~~~~~
      |                                           |                                      |
      |                                           int                                    OPJ_UINT32 {aka long unsigned int}
      |                                          %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11031:49: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11031 |             fprintf(out_stream, "\t\t\t qntsty=%d\n", l_tccp->qntsty);
      |                                                ~^     ~~~~~~~~~~~~~~
      |                                                 |           |
      |                                                 int         OPJ_UINT32 {aka long unsigned int}
      |                                                %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11032:51: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11032 |             fprintf(out_stream, "\t\t\t numgbits=%d\n", l_tccp->numgbits);
      |                                                  ~^     ~~~~~~~~~~~~~~~~
      |                                                   |           |
      |                                                   int         OPJ_UINT32 {aka long unsigned int}
      |                                                  %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11037:40: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_INT32' {aka 'long int'} [-Wformat=]
11037 |                 fprintf(out_stream, "(%d,%d) ", l_tccp->stepsizes[bandno].mant,
      |                                       ~^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                        |                                 |
      |                                        int                               OPJ_INT32 {aka long int}
      |                                       %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11037:43: warning: format '%d' expects argument of type 'int', but argument 4 has type 'OPJ_INT32' {aka 'long int'} [-Wformat=]
11037 |                 fprintf(out_stream, "(%d,%d) ", l_tccp->stepsizes[bandno].mant,
      |                                          ~^
      |                                           |
      |                                           int
      |                                          %ld
11038 |                         l_tccp->stepsizes[bandno].expn);
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                  |
      |                                                  OPJ_INT32 {aka long int}
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11043:51: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_INT32' {aka 'long int'} [-Wformat=]
11043 |             fprintf(out_stream, "\t\t\t roishift=%d\n", l_tccp->roishift);
      |                                                  ~^     ~~~~~~~~~~~~~~~~
      |                                                   |           |
      |                                                   int         OPJ_INT32 {aka long int}
      |                                                  %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c: In function 'opj_j2k_dump_MH_index':
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11141:69: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11141 |         fprintf(out_stream, "\t\t nb of tile-part in tile [%d]=%d\n", it_tile,
      |                                                            ~^         ~~~~~~~
      |                                                             |         |
      |                                                             int       OPJ_UINT32 {aka long unsigned int}
      |                                                            %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11141:73: warning: format '%d' expects argument of type 'int', but argument 4 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11141 |     fprintf(out_stream, "\t\t nb of tile-part in tile [%d]=%d\n", it_tile,
      |                                                            ~^
      |                                                             |
      |                                                             int
      |                                                            %ld
11142 |             nb_of_tile_part);
      |             ~~~~~~~~~~~~~~~                                  
      |             |
      |             OPJ_UINT32 {aka long unsigned int}

/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11146:45: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11146 |                         fprintf(out_stream, "\t\t\t tile-part[%d]: star_pos=%" PRIi64 ", end_header=%"
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11147 |                                 PRIi64 ", end_pos=%" PRIi64 ".\n",
11148 |                                 it_tile_part,
      |                                 ~~~~~~~~~~~~ 
      |                                 |
      |                                 OPJ_UINT32 {aka long unsigned int}
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c: In function 'opj_j2k_dump_MH_info':
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11179:34: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11179 |     fprintf(out_stream, "\t tx0=%d, ty0=%d\n", p_j2k->m_cp.tx0, p_j2k->m_cp.ty0);
      |                                 ~^             ~~~~~~~~~~~~~~~
      |                                  |                        |
      |                                  int                      OPJ_UINT32 {aka long unsigned int}
      |                                 %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11179:42: warning: format '%d' expects argument of type 'int', but argument 4 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11179 |     fprintf(out_stream, "\t tx0=%d, ty0=%d\n", p_j2k->m_cp.tx0, p_j2k->m_cp.ty0);
      |                                         ~^                      ~~~~~~~~~~~~~~~
      |                                          |                                 |
      |                                          int                               OPJ_UINT32 {aka long unsigned int}
      |                                         %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11180:34: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11180 |     fprintf(out_stream, "\t tdx=%d, tdy=%d\n", p_j2k->m_cp.tdx, p_j2k->m_cp.tdy);
      |                                 ~^             ~~~~~~~~~~~~~~~
      |                                  |                        |
      |                                  int                      OPJ_UINT32 {aka long unsigned int}
      |                                 %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11180:42: warning: format '%d' expects argument of type 'int', but argument 4 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11180 |     fprintf(out_stream, "\t tdx=%d, tdy=%d\n", p_j2k->m_cp.tdx, p_j2k->m_cp.tdy);
      |                                         ~^                      ~~~~~~~~~~~~~~~
      |                                          |                                 |
      |                                          int                               OPJ_UINT32 {aka long unsigned int}
      |                                         %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11181:33: warning: format '%d' expects argument of type 'int', but argument 3 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11181 |     fprintf(out_stream, "\t tw=%d, th=%d\n", p_j2k->m_cp.tw, p_j2k->m_cp.th);
      |                                ~^            ~~~~~~~~~~~~~~
      |                                 |                       |
      |                                 int                     OPJ_UINT32 {aka long unsigned int}
      |                                %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11181:40: warning: format '%d' expects argument of type 'int', but argument 4 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11181 |     fprintf(out_stream, "\t tw=%d, th=%d\n", p_j2k->m_cp.tw, p_j2k->m_cp.th);
      |                                       ~^                     ~~~~~~~~~~~~~~
      |                                        |                                |
      |                                        int                              OPJ_UINT32 {aka long unsigned int}
      |                                       %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c: In function 'j2k_dump_image_header':
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11201:33: warning: format '%d' expects argument of type 'int', but argument 4 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11201 |     fprintf(out_stream, "%s x0=%d, y0=%d\n", tab, img_header->x0, img_header->y0);
      |                                ~^                 ~~~~~~~~~~~~~~
      |                                 |                           |
      |                                 int                         OPJ_UINT32 {aka long unsigned int}
      |                                %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11201:40: warning: format '%d' expects argument of type 'int', but argument 5 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11201 |     fprintf(out_stream, "%s x0=%d, y0=%d\n", tab, img_header->x0, img_header->y0);
      |                                       ~^                          ~~~~~~~~~~~~~~
      |                                        |                                    |
      |                                        int                                  OPJ_UINT32 {aka long unsigned int}
      |                                       %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11202:37: warning: format '%d' expects argument of type 'int', but argument 4 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11202 |     fprintf(out_stream,     "%s x1=%d, y1=%d\n", tab, img_header->x1,
      |                                    ~^                 ~~~~~~~~~~~~~~
      |                                     |                           |
      |                                     int                         OPJ_UINT32 {aka long unsigned int}
      |                                    %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11202:44: warning: format '%d' expects argument of type 'int', but argument 5 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11202 |     fprintf(out_stream,     "%s x1=%d, y1=%d\n", tab, img_header->x1,
      |                                           ~^
      |                                            |
      |                                            int
      |                                           %ld
11203 |             img_header->y1);
      |             ~~~~~~~~~~~~~~                  
      |                       |
      |                       OPJ_UINT32 {aka long unsigned int}
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11204:39: warning: format '%d' expects argument of type 'int', but argument 4 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11204 |     fprintf(out_stream, "%s numcomps=%d\n", tab, img_header->numcomps);
      |                                      ~^          ~~~~~~~~~~~~~~~~~~~~
      |                                       |                    |
      |                                       int                  OPJ_UINT32 {aka long unsigned int}
      |                                      %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11209:50: warning: format '%d' expects argument of type 'int', but argument 4 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11209 |             fprintf(out_stream, "%s\t component %d {\n", tab, compno);
      |                                                 ~^            ~~~~~~
      |                                                  |            |
      |                                                  int          OPJ_UINT32 {aka long unsigned int}
      |                                                 %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c: In function 'j2k_dump_image_comp_header':
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11233:33: warning: format '%d' expects argument of type 'int', but argument 4 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11233 |     fprintf(out_stream, "%s dx=%d, dy=%d\n", tab, comp_header->dx, comp_header->dy);
      |                                ~^                 ~~~~~~~~~~~~~~~
      |                                 |                            |
      |                                 int                          OPJ_UINT32 {aka long unsigned int}
      |                                %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11233:40: warning: format '%d' expects argument of type 'int', but argument 5 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11233 |     fprintf(out_stream, "%s dx=%d, dy=%d\n", tab, comp_header->dx, comp_header->dy);
      |                                       ~^                           ~~~~~~~~~~~~~~~
      |                                        |                                      |
      |                                        int                                    OPJ_UINT32 {aka long unsigned int}
      |                                       %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11234:35: warning: format '%d' expects argument of type 'int', but argument 4 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11234 |     fprintf(out_stream, "%s prec=%d\n", tab, comp_header->prec);
      |                                  ~^          ~~~~~~~~~~~~~~~~~
      |                                   |                     |
      |                                   int                   OPJ_UINT32 {aka long unsigned int}
      |                                  %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c:11235:35: warning: format '%d' expects argument of type 'int', but argument 4 has type 'OPJ_UINT32' {aka 'long unsigned int'} [-Wformat=]
11235 |     fprintf(out_stream, "%s sgnd=%d\n", tab, comp_header->sgnd);
      |                                  ~^          ~~~~~~~~~~~~~~~~~
      |                                   |                     |
      |                                   int                   OPJ_UINT32 {aka long unsigned int}
      |                                  %ld
/home/kowshik/Desktop/opencv_porting/opencv/3rdparty/openjpeg/openjp2/j2k.c: At top level:
cc1: note: unrecognized command-line option '-Wno-implicit-const-int-float-conversion' may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option '-Wno-unnamed-type-template-args' may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option '-Wno-dev' may have been intended to silence earlier diagnostics
[  3%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/jp2.c.obj
[  3%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/mct.c.obj
[  3%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/mqc.c.obj
[  4%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/openjpeg.c.obj
[  4%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/opj_clock.c.obj
[  4%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/pi.c.obj
[  5%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/t1.c.obj
[  5%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/t2.c.obj
[  5%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/tcd.c.obj
[  6%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/tgt.c.obj
[  6%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/function_list.c.obj
[  6%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/opj_malloc.c.obj
[  7%] Building C object 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/sparse_array.c.obj
[  7%] Linking C static library ../../lib/liblibopenjp2.a
[  7%] Built target libopenjp2
[  7%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/adler32.c.obj
[  8%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/compress.c.obj
[  8%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/crc32.c.obj
[  8%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/deflate.c.obj
[  9%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzclose.c.obj
[  9%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzlib.c.obj
[  9%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzread.c.obj
[ 10%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzwrite.c.obj
[ 10%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/inflate.c.obj
[ 10%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/infback.c.obj
[ 11%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/inftrees.c.obj
[ 11%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/inffast.c.obj
[ 11%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/trees.c.obj
[ 12%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/uncompr.c.obj
[ 12%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/zutil.c.obj
[ 13%] Linking C static library ../lib/libzlib.a
[ 13%] Built target zlib
[ 13%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/png.c.obj
[ 14%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngerror.c.obj
[ 14%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngget.c.obj
[ 14%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngmem.c.obj
[ 15%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngpread.c.obj
[ 15%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngread.c.obj
[ 16%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngrio.c.obj
[ 16%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngrtran.c.obj
[ 16%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngrutil.c.obj
[ 17%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngset.c.obj
[ 17%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngtrans.c.obj
[ 17%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngwio.c.obj
[ 18%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngwrite.c.obj
[ 18%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngwtran.c.obj
[ 18%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/pngwutil.c.obj
[ 19%] Linking C static library ../lib/liblibpng.a
[ 19%] Built target libpng
[ 20%] Processing OpenCL kernels (video)
[ 20%] Processing OpenCL kernels (core)
[ 20%] Processing OpenCL kernels (features2d)
[ 20%] Processing OpenCL kernels (imgproc)
[ 20%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/core/src/algorithm.cpp.obj
In file included from /home/kowshik/Desktop/opencv_porting/opencv/modules/core/src/precomp.hpp:53,
                 from /home/kowshik/Desktop/opencv_porting/opencv/modules/core/src/algorithm.cpp:43:
/home/kowshik/Desktop/opencv_porting/opencv/modules/core/include/opencv2/core/utility.hpp:718:14: error: 'recursive_mutex' in namespace 'std' does not name a type
  718 | typedef std::recursive_mutex Mutex;
      |              ^~~~~~~~~~~~~~~
/home/kowshik/Desktop/opencv_porting/opencv/modules/core/include/opencv2/core/utility.hpp:63:1: note: 'std::recursive_mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
   62 | #include <mutex>  // std::mutex, std::lock_guard
  +++ |+#include <mutex>
   63 | #endif
/home/kowshik/Desktop/opencv_porting/opencv/modules/core/include/opencv2/core/utility.hpp:719:29: error: 'Mutex' is not a member of 'cv'
  719 | typedef std::lock_guard<cv::Mutex> AutoLock;
      |                             ^~~~~
/home/kowshik/Desktop/opencv_porting/opencv/modules/core/include/opencv2/core/utility.hpp:719:29: error: 'Mutex' is not a member of 'cv'
/home/kowshik/Desktop/opencv_porting/opencv/modules/core/include/opencv2/core/utility.hpp:719:34: error: template argument 1 is invalid
  719 | typedef std::lock_guard<cv::Mutex> AutoLock;
      |                                  ^
In file included from /home/kowshik/Desktop/opencv_porting/opencv/modules/core/src/algorithm.cpp:43:
/home/kowshik/Desktop/opencv_porting/opencv/modules/core/src/precomp.hpp:369:5: error: 'Mutex' in namespace 'cv' does not name a type
  369 | cv::Mutex& getInitializationMutex();
      |     ^~~~~
cc1plus: note: unrecognized command-line option '-Wno-unnamed-type-template-args' may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option '-Wno-dev' may have been intended to silence earlier diagnostics
make[2]: *** [modules/world/CMakeFiles/opencv_world.dir/build.make:170: modules/world/CMakeFiles/opencv_world.dir/__/core/src/algorithm.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:839: modules/world/CMakeFiles/opencv_world.dir/all] Error 2
make: *** [Makefile:166: all] Error 2```

Thanks

try to delete build folder and rerun cmake

I did try that couple of times, didn’t help.

hmm, that’s a compiler problem, it does not know, what a Mutex is
still cross-compiling ?

Hi berak,

yes I am trying to cross-compile it to cortex-r5 platform by using the arm-none-eabi-gcc compiler which I got from the ARM’s official website. Also I am little confused when you said “Compiler doesn’t know what a mutex is?” How is this a compiler attribute? I think It’s a cpp implementation that should be present. Correct me if wrong.

Thanks

and, does it support posix threads ?

exactly, as a part of the std libs, this compiler supports

How do I verify that please? I found on internet where I can run this command arm-none-eabi-g++ -xc -E -v - to see with what tags the compiler is built and I see the flag --disable-threads in the below log, Is this a problem? :neutral_face: if yes, how do I fix it?

Using built-in specs.
COLLECT_GCC=arm-none-eabi-g++
Target: arm-none-eabi
Configured with: /mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gcc/configure --target=arm-none-eabi --prefix=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/install-native --libexecdir=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/install-native/lib --infodir=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/install-native/arm-none-eabi --build=x86_64-linux-gnu --host=x86_64-linux-gnu --with-gmp=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/build-native/host-libs/usr --with-mpfr=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/build-native/host-libs/usr --with-mpc=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/build-native/host-libs/usr --with-isl=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/build-native/host-libs/usr --with-libelf=/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/build-native/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Arm Embedded Toolchain 10.3-2021.10' --with-multilib-list=rmprofile,aprofile
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.3.1 20210824 (release) (GNU Arm Embedded Toolchain 10.3-2021.10) 
COLLECT_GCC_OPTIONS='-E' '-v' '-mcpu=arm7tdmi' '-mfloat-abi=soft' '-marm' '-mlibarch=armv4t' '-march=armv4t'
 /home/kowshik/Documents/gcc/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/cc1 -E -quiet -v -iprefix /home/kowshik/Documents/gcc/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/ -isysroot /home/kowshik/Documents/gcc/gcc-arm-none-eabi-10.3-2021.10/bin/../arm-none-eabi -D__USES_INITFINI__ - -mcpu=arm7tdmi -mfloat-abi=soft -marm -mlibarch=armv4t -march=armv4t
ignoring duplicate directory "/home/kowshik/Documents/gcc/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/../../lib/gcc/arm-none-eabi/10.3.1/include"
ignoring nonexistent directory "/home/kowshik/Documents/gcc/gcc-arm-none-eabi-10.3-2021.10/bin/../arm-none-eabi/usr/local/include"
ignoring duplicate directory "/home/kowshik/Documents/gcc/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/../../lib/gcc/arm-none-eabi/10.3.1/include-fixed"
ignoring duplicate directory "/home/kowshik/Documents/gcc/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/../../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/include"
ignoring nonexistent directory "/home/kowshik/Documents/gcc/gcc-arm-none-eabi-10.3-2021.10/bin/../arm-none-eabi/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/kowshik/Documents/gcc/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/include
 /home/kowshik/Documents/gcc/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/include-fixed
 /home/kowshik/Documents/gcc/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/include
End of search list.

Hi,

Update on this issue. I was able to get the lib built after reading through the code and found I disabled the PTHREADS_PF Flag. After I enabled it, compilation worked.

To answer this, yes my compiler supports pthreads. I confirmed it from the compiler’s source files.

1 Like