Compile failure when including <opencv/cv.h> after <X11/Xlib.h> (Patch #1562)


Added by Markus Schwarzenberg about 13 years ago. Updated about 12 years ago.


Status:Done Start date:
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:flann
Target version:2.4.3
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

("my") <X11/Xlib.h> (fedora 16) contains

1#define True 1
2#define False 0

OpenCV-2.3.1/modules/flann/include/opencv2/flann/dist.h has (inside namespace cvflann):

1class True
2{
3};
4
5class False
6{
7};

The Xlib.h #defines make compilation fail.
A simple workaround is:
1#include <X11/Xlib.h>
2#undef True
3#undef False
4#include <cv.h>

But perhaps the #undefs could be added inside flann/dist.h ?


Related issues

duplicated by Bug #2529: opencv uses True and and False as class names - clashes w... Cancelled 2012-11-10

Associated revisions

Revision d54f4e1c
Added by Vadim Pisarevsky over 12 years ago

added #undef True/False to avoid collision with X11 (Patch #1562)

Revision 2660f4bc
Added by Roman Donchenko over 11 years ago

Merge pull request #1562 from ilya-lavrenov:ocl_integral

History

Updated by Alexander Shishkov about 13 years ago

  • Description changed from ("my") <X11/Xlib.h> (fedora 16) contains #define True 1 #def... to ("my") <X11/Xlib.h> (fedora 16) contains #define True 1 #def... More

Updated by Alexander Shishkov almost 13 years ago

  • Tracker changed from Bug to Patch
  • Target version deleted ()
  • Description changed from ("my") <X11/Xlib.h> (fedora 16) contains #define True 1 #def... to ("my") <X11/Xlib.h> (fedora 16) contains <pre><code... More

Updated by Alexander Shishkov almost 13 years ago

  • Assignee deleted (Marius Muja)

Updated by Alexander Shishkov almost 13 years ago

  • Target version deleted ()

Updated by Vadim Pisarevsky over 12 years ago

  • Target version deleted ()

Updated by Vadim Pisarevsky over 12 years ago

thanks! the undef's have been added in d54f4e1

  • Status changed from Open to Done
  • Assignee set to Vadim Pisarevsky

Updated by Andrey Kamaev about 12 years ago

  • Target version set to 2.4.3

Also available in: Atom PDF