Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 393555 - media-gfx/gmic-1.5.0.7 - /usr/include/opencv2/flann/dist.h:82:7: error: expected identifier before numeric constant
Summary: media-gfx/gmic-1.5.0.7 - /usr/include/opencv2/flann/dist.h:82:7: error: expec...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Tim Harder
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-07 23:12 UTC by Jean-Francois Ostiguy
Modified: 2011-12-31 22:33 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Complete build log (build.log,42.23 KB, text/plain)
2011-12-07 23:12 UTC, Jean-Francois Ostiguy
Details
emerge --info (emerge.info,5.59 KB, text/plain)
2011-12-07 23:13 UTC, Jean-Francois Ostiguy
Details
patch for opencv (opencv-2.3.1a-True-False.patch,5.00 KB, patch)
2011-12-08 22:11 UTC, Jean-Francois Ostiguy
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Francois Ostiguy 2011-12-07 23:12:02 UTC
media-gfx/gmic-1.5.0.7 fails to emerge 

relevant output from build log:

********************************************************
... 
x86_64-pc-linux-gnu-g++ -o gmic_char.o -c gmic.cpp -Dgmic_separate_compilation -Dgmic_char -march=core2 -O2 -pipe -fno-strict-aliasing -Dgmic_build -I/usr/include  -Dcimg_
display=1 -Dcimg_appname=\"gmic\" -I/usr/X11R6/include  -Dcimg_use_xshm -Dcimg_use_png -Dcimg_use_jpeg -Dcimg_use_tiff -Dcimg_use_zlib -Dcimg_use_fftw3 -Dcimg_use_openexr 
-I/usr/include/OpenEXR -Dcimg_use_magick -I/usr/include/GraphicsMagick -Dcimg_use_ffmpeg -D__STDC_CONSTANT_MACROS -I/usr/include/libavcodec -I/usr/include/libavformat -I/u
sr/include/libswscale -I/usr/include/ffmpeg -Dcimg_use_opencv -I/usr/include/opencv 
In file included from /usr/include/opencv2/flann/dynamic_bitset.h:46:0,
                 from /usr/include/opencv2/flann/kdtree_index.h:41,
                 from /usr/include/opencv2/flann/all_indices.h:36,
                 from /usr/include/opencv2/flann/flann_base.hpp:44,
                 from /usr/include/opencv2/flann/flann.hpp:50,
                 from /usr/include/opencv/cv.h:69,
                 from ./CImg.h:238,
                 from gmic.h:71,
                 from gmic.cpp:789:
/usr/include/opencv2/flann/dist.h:82:7: error: expected identifier before numeric constant
/usr/include/opencv2/flann/dist.h:82:7: error: expected unqualified-id before numeric constant
/usr/include/opencv2/flann/dist.h:86:7: error: expected identifier before numeric constant
/usr/include/opencv2/flann/dist.h:86:7: error: expected unqualified-id before numeric constant

******************************************

When I look at the file 

/usr/include/opencv2/flann/dist.h

I see around line 82  that two empty classes named "True" and "False" are defined. I suspect that a header file where "True" and "False" are #defined
is getting picked up. 

One my machine I see a few possible candidates:

find . -exec grep "define[[:space:]]*True" {} \; -print

#define  True   ((Bool)1)
./valgrind/libvex_basictypes.h
#define True 1
./X11/ICE/ICElib.h
#define True 1
./X11/Xlib.h
#define True    1
./X11/extensions/XKBsrv.h
# define True  1L
./X11/extensions/xtrapdi.h
#define True    1
./X11/fonts/FSlib.h
#define TrueColor               4
./X11/X.h
#define True true
./UsageEnvironment/Boolean.hh
#define TrueColorMask   (1 << TrueColor)
./xorg/micmap.h
#  define True 1
./libAfterImage/xwrap.h
#define True 1
./qhull/libqhull.h

I also note that /usr/include/opencv2/flann/dist.h belongs to  

media-libs/opencv-2.3.1a

so one could argue that the problem lies there, and that it is the package that needs to be fixed ... although it emerges cleanly.  Substituting "IsTrue" and "IsFalse" for "True" and "False" would probably eliminate the issue, although I have not found the time to check this.   



Reproducible: Always
Comment 1 Jean-Francois Ostiguy 2011-12-07 23:12:45 UTC
Created attachment 295139 [details]
Complete build log
Comment 2 Jean-Francois Ostiguy 2011-12-07 23:13:51 UTC
Created attachment 295141 [details]
emerge --info
Comment 3 trogdog 2011-12-08 12:45:22 UTC
unmasking this package and emerging with default use flags plus (ffmpeg fftw graphicsmagick opencv openxr) builds ok on amd64 - may help with narrowing down where problem lies.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2011-12-08 17:12:40 UTC
Looks like bug #392321 but probably isn't.
Comment 5 Jean-Francois Ostiguy 2011-12-08 22:11:31 UTC
Created attachment 295225 [details, diff]
patch for opencv


This patch renames the empty classes "True" and "False" in the opencv 2.3.1a source to XTrue and XFalse. After applying this this fix to opencv, gmic compiles. I will file a bug for opencv since it is really the culprit.
Comment 6 Andreas K. Hüttel archtester gentoo-dev 2011-12-31 22:19:50 UTC
@Tim: I added the patch to opencv-2.3.1a-r1, you can DEPEND on this version and then the problem should be fixed.
Comment 7 Tim Harder gentoo-dev 2011-12-31 22:33:07 UTC
(In reply to comment #6)
> @Tim: I added the patch to opencv-2.3.1a-r1, you can DEPEND on this version and
> then the problem should be fixed.

Done.