[MacPorts] #38168: Conflicting declarations in tiff and opencv
#38168: Conflicting declarations in tiff and opencv ------------------------+-------------------------------- Reporter: karo03de@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Keywords: | Port: tiff & opencv ------------------------+-------------------------------- Compiling a program (gmic from gmic.scourceforge.net) using libtiff AND opencv throws errors concerning conflicting declarations. The error occurs since upgrade to MacPorts 2.1.3 : In file included from /opt/local/include/tiffio.h:33, from ./CImg.h:286, from gmic.h:71, from gmic.cpp:884: /opt/local/include/tiff.h:77: error: conflicting declaration ‘typedef long int int64’ /opt/local/include/opencv2/core/types_c.h:163: error: ‘int64’ has a previous declaration as ‘typedef int64_t int64’ /opt/local/include/tiff.h:78: error: conflicting declaration ‘typedef long unsigned int uint64’ /opt/local/include/opencv2/core/types_c.h:164: error: ‘uint64’ has a previous declaration as ‘typedef uint64_t uint64’ A workaround would be helpful. -- Ticket URL: <https://trac.macports.org/ticket/38168> MacPorts <http://www.macports.org/> Ports system for Mac OS
#38168: Conflicting declarations in tiff and opencv --------------------------+------------------------ Reporter: karo03de@… | Owner: stromnov@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: tiff opencv | --------------------------+------------------------ Changes (by larryv@…): * owner: macports-tickets@… => stromnov@… * port: tiff & opencv => tiff opencv Old description:
Compiling a program (gmic from gmic.scourceforge.net) using libtiff AND opencv throws errors concerning conflicting declarations. The error occurs since upgrade to MacPorts 2.1.3 :
In file included from /opt/local/include/tiffio.h:33, from ./CImg.h:286, from gmic.h:71, from gmic.cpp:884: /opt/local/include/tiff.h:77: error: conflicting declaration ‘typedef long int int64’ /opt/local/include/opencv2/core/types_c.h:163: error: ‘int64’ has a previous declaration as ‘typedef int64_t int64’ /opt/local/include/tiff.h:78: error: conflicting declaration ‘typedef long unsigned int uint64’ /opt/local/include/opencv2/core/types_c.h:164: error: ‘uint64’ has a previous declaration as ‘typedef uint64_t uint64’
A workaround would be helpful.
New description: Compiling a program (gmic from gmic.scourceforge.net) using libtiff AND opencv throws errors concerning conflicting declarations. The error occurs since upgrade to MacPorts 2.1.3 : {{{ In file included from /opt/local/include/tiffio.h:33, from ./CImg.h:286, from gmic.h:71, from gmic.cpp:884: /opt/local/include/tiff.h:77: error: conflicting declaration ‘typedef long int int64’ /opt/local/include/opencv2/core/types_c.h:163: error: ‘int64’ has a previous declaration as ‘typedef int64_t int64’ /opt/local/include/tiff.h:78: error: conflicting declaration ‘typedef long unsigned int uint64’ /opt/local/include/opencv2/core/types_c.h:164: error: ‘uint64’ has a previous declaration as ‘typedef uint64_t uint64’ }}} A workaround would be helpful. -- -- Ticket URL: <https://trac.macports.org/ticket/38168#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#38168: Conflicting declarations in tiff and opencv --------------------------+------------------------ Reporter: karo03de@… | Owner: stromnov@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: tiff opencv | --------------------------+------------------------ Comment (by karo03de@…): Hi, I have tried around to overcome this conflicting declaration. By changing in types_c.h from opencv the lines 163 and 164 to typedef long int int64; typedef long unsigned int uint64; the error does not occur anymore. This would only concern opencv. Is there anybody maintaining this port ? -- Ticket URL: <https://trac.macports.org/ticket/38168#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#38168: Conflicting declarations in tiff and opencv --------------------------+------------------------ Reporter: karo03de@… | Owner: stromnov@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: tiff opencv | --------------------------+------------------------ Comment (by stromnov@…): Changing {{{ typedef int64_t int64; typedef uint64_t uint64; }}} to {{{ typedef long int int64; typedef long unsigned int uint64; }}} is a very bad idea (exceptionally for non-64bit platform). -- Ticket URL: <https://trac.macports.org/ticket/38168#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#38168: Conflicting declarations in tiff and opencv --------------------------+------------------------ Reporter: karo03de@… | Owner: stromnov@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: tiff opencv | --------------------------+------------------------ Comment (by karo03de@…): Replying to [comment:3 stromnov@…]:
Changing {{{ typedef int64_t int64; typedef uint64_t uint64; }}} to {{{ typedef long int int64; typedef long unsigned int uint64; }}} is a very bad idea (exceptionally for non-64bit platform).
Possibly the change in tiffconf.h in the lines or according those lines {{{ /* Signed 64-bit type */ #ifndef __LP64__ #define TIFF_INT64_T signed long long #else /* __LP64__ */ #define TIFF_INT64_T signed long #endif /* __LP64__ */ /* Signed 8-bit type */ #define TIFF_INT8_T signed char /* Unsigned 16-bit type */ #define TIFF_UINT16_T unsigned short /* Unsigned 32-bit type */ #define TIFF_UINT32_T unsigned int /* Unsigned 64-bit type */ #ifndef __LP64__ #define TIFF_UINT64_T unsigned long long #else /* __LP64__ */ #define TIFF_UINT64_T unsigned long #endif /* __LP64__ */ }}} is better ? -- Ticket URL: <https://trac.macports.org/ticket/38168#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#38168: Conflicting declarations in tiff and opencv --------------------------+------------------------ Reporter: karo03de@… | Owner: stromnov@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: tiff opencv | --------------------------+------------------------ Comment (by stromnov@…): tiffconf.h constructed at configure phase, so it would be difficult to apply this patch. Please, attach debug log, I can't reproduce this issue. -- Ticket URL: <https://trac.macports.org/ticket/38168#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#38168: Conflicting declarations in tiff and opencv --------------------------+------------------------ Reporter: karo03de@… | Owner: stromnov@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: tiff opencv | --------------------------+------------------------ Comment (by karo03de@…): Replying to [comment:5 stromnov@…]:
tiffconf.h constructed at configure phase, so it would be difficult to apply this patch.
Please, attach debug log, I can't reproduce this issue.
I am trying to build gmic from gmic.sourceforge.net with standard settings plus the opencv camera part: the output of make is perhaps what you mean: {{{ make -B -j2 "OPT_CFLAGS = -Dcimg_use_opencv `pkg-config opencv --cflags` -fno-tree-pre -ffast-math" "OPT_LDFLAGS= -Dcimg_use_opencv `pkg-config opencv --libs`" macosx make "CFLAGS=-Dgmic_build -I/opt/local/include -Wall -W -Dgmic_is_beta=1 -Dcimg_display=1 -Dcimg_appname=\\\"gmic\\\" -I/usr/X11R6/include -Dcimg_use_zlib -Dcimg_use_png -Dcimg_use_jpeg -Dcimg_use_tiff -Dcimg_use_openexr -I/opt/local/include/OpenEXR -Dcimg_use_fftw3 -Dcimg_use_opencv -I/opt/local/include/opencv -I/opt/local/include -fno- tree-pre -ffast-math" "LDFLAGS=-L/opt/local/lib -lm -L/usr/X11R6/lib -lX11 -lpthread -lz -lpng -lz -ljpeg -ltiff -lIlmImf -lHalf -lfftw3 -Dcimg_use_opencv /opt/local/lib/libopencv_calib3d.dylib /opt/local/lib/libopencv_contrib.dylib /opt/local/lib/libopencv_core.dylib /opt/local/lib/libopencv_features2d.dylib /opt/local/lib/libopencv_flann.dylib /opt/local/lib/libopencv_gpu.dylib /opt/local/lib/libopencv_highgui.dylib /opt/local/lib/libopencv_imgproc.dylib /opt/local/lib/libopencv_legacy.dylib /opt/local/lib/libopencv_ml.dylib /opt/local/lib/libopencv_nonfree.dylib /opt/local/lib/libopencv_objdetect.dylib /opt/local/lib/libopencv_photo.dylib /opt/local/lib/libopencv_stitching.dylib /opt/local/lib/libopencv_ts.dylib /opt/local/lib/libopencv_video.dylib /opt/local/lib/libopencv_videostab.dylib " gmic_gmic g++ -o gmic_bool.o -c gmic.cpp -Dgmic_build -I/opt/local/include -Wall -W -Dgmic_is_beta=1 -Dcimg_display=1 -Dcimg_appname=\"gmic\" -I/usr/X11R6/include -Dcimg_use_zlib -Dcimg_use_png -Dcimg_use_jpeg -Dcimg_use_tiff -Dcimg_use_openexr -I/opt/local/include/OpenEXR -Dcimg_use_fftw3 -Dcimg_use_opencv -I/opt/local/include/opencv -I/opt/local/include -fno-tree-pre -ffast-math -Dgmic_split_compilation -Dgmic_bool g++ -o gmic_uchar.o -c gmic.cpp -Dgmic_build -I/opt/local/include -Wall -W -Dgmic_is_beta=1 -Dcimg_display=1 -Dcimg_appname=\"gmic\" -I/usr/X11R6/include -Dcimg_use_zlib -Dcimg_use_png -Dcimg_use_jpeg -Dcimg_use_tiff -Dcimg_use_openexr -I/opt/local/include/OpenEXR -Dcimg_use_fftw3 -Dcimg_use_opencv -I/opt/local/include/opencv -I/opt/local/include -fno-tree-pre -ffast-math -Dgmic_split_compilation -Dgmic_uchar In file included from /opt/local/include/tiffio.h:33, from ./CImg.h:286, from gmic.h:71, from gmic.cpp:1032: /opt/local/include/tiff.h:77: error: conflicting declaration ‘typedef long int int64’ /opt/local/include/opencv2/core/types_c.h:163: error: ‘int64’ has a previous declaration as ‘typedef int64_t int64’ /opt/local/include/tiff.h:78: error: conflicting declaration ‘typedef long unsigned int uint64’ /opt/local/include/opencv2/core/types_c.h:164: error: ‘uint64’ has a previous declaration as ‘typedef uint64_t uint64’ In file included from /opt/local/include/tiffio.h:33, from ./CImg.h:286, from gmic.h:71, from gmic.cpp:1032: /opt/local/include/tiff.h:77: error: conflicting declaration ‘typedef long int int64’ /opt/local/include/opencv2/core/types_c.h:163: error: ‘int64’ has a previous declaration as ‘typedef int64_t int64’ /opt/local/include/tiff.h:78: error: conflicting declaration ‘typedef long unsigned int uint64’ /opt/local/include/opencv2/core/types_c.h:164: error: ‘uint64’ has a previous declaration as ‘typedef uint64_t uint64’ make[1]: *** [gmic_uchar.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: *** [gmic_bool.o] Error 1 make: *** [macosx] Error 2 }}} -- Ticket URL: <https://trac.macports.org/ticket/38168#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#38168: Conflicting declarations in tiff and opencv --------------------------+------------------------ Reporter: karo03de@… | Owner: stromnov@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: tiff opencv | --------------------------+------------------------ Comment (by stromnov@…): Compiling from sources or from macports (sudo port install gmic) ? -- Ticket URL: <https://trac.macports.org/ticket/38168#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#38168: Conflicting declarations in tiff and opencv --------------------------+------------------------ Reporter: karo03de@… | Owner: stromnov@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: tiff opencv | --------------------------+------------------------ Comment (by karo03de@…): Replying to [comment:7 stromnov@…]:
Compiling from sources or from macports (sudo port install gmic) ?
Compiling from source, gmic is still not in MacPorts. (It consists of a terminal version and of a Gimp plugin which don't necessitates MacPorts installation). -- Ticket URL: <https://trac.macports.org/ticket/38168#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#38168: Conflicting declarations in tiff and opencv --------------------------+------------------------ Reporter: karo03de@… | Owner: stromnov@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: tiff opencv | --------------------------+------------------------ Comment (by karo03de@…): By the way the terminal version of gmic could be added to MacPorts, but the Gimp plugin is difficult (at least for me) -- Ticket URL: <https://trac.macports.org/ticket/38168#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
#38168: Conflicting declarations in tiff and opencv --------------------------+------------------------ Reporter: karo03de@… | Owner: stromnov@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: tiff opencv | --------------------------+------------------------ Comment (by frederic.devernay@…): The following fix in CImg.h is the most portable solution. Got the idea from the OpenCV source code: https://github.com/Itseez/opencv/commit/33c26a93c6d97013b14e7dd080a347e242ef... Hopefully, David will include this in the next CImg release. Anyone who wants to include tiff.h or tiffio.h in a portable way should do this. {{{ Index: CImg.h =================================================================== --- CImg.h (révision 12475) +++ CImg.h (copie de travail) @@ -284,7 +284,11 @@ // (see methods 'CImg[List]<T>::{load,save}_tiff()'). #ifdef cimg_use_tiff extern "C" { +#define uint64 uint64_hack_ +#define int64 int64_hack_ #include "tiffio.h" +#undef uint64 +#indef uint64 } #endif }}} -- Ticket URL: <https://trac.macports.org/ticket/38168#comment:10> MacPorts <http://www.macports.org/> Ports system for OS X
#38168: Conflicting declarations in tiff and opencv --------------------------+------------------------ Reporter: karo03de@… | Owner: stromnov@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: tiff opencv | --------------------------+------------------------ Changes (by ryandesign@…): * cc: ryandesign@… (added) Comment: See also #41280. -- Ticket URL: <https://trac.macports.org/ticket/38168#comment:11> MacPorts <http://www.macports.org/> Ports system for OS X
#38168: Conflicting declarations in tiff and opencv --------------------------+------------------------ Reporter: karo03de@… | Owner: stromnov@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: tiff opencv | --------------------------+------------------------ Comment (by mojca@…): Can you please try again? As noted in #41280 I committed a minimal patch in r113360 which might also solve this particular issue. -- Ticket URL: <https://trac.macports.org/ticket/38168#comment:14> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts