[Insight-users] Error building ITK on Linux

Luis Ibanez luis.ibanez@kitware.com
Mon, 21 Oct 2002 15:14:15 -0400


Hi Ghassan,

This error is due to an unfortunate ordering
including header files.

The X11 header file  Xutil.h has a type named
"Region" defined in the global namespace in line
233.

Basically X11 considered that nobody else would
ever want to create a type named "Region".

ITK has an itk::Region type that is nicely
encapsulated inside the "itk::" namespace.
Unfortunately X11 do not use namespaces so when
the "Region" type is used in a file that includes
both Xutil.h and itkRegion.h a conflict appears.

This problem existed on the Beta version and
has been solved in the current version basically
by reordering in which headers are included.

You may wan to try downloading the IViewGUI.fld
file from the cvsweb server:

http://www.itk.org/cgi-bin/cvsweb.cgi/Insight/Auxiliary/MetaImage/IView/Attic/IViewGUIBase.fld?cvsroot=Insight

Please let us know if you find further problems,


Thanks

    Luis



---------------------------------------------------

Ghassan Hamarneh wrote:

> Would you know how to resolve this problem?
> Thanks,
> /Ghassan
> 
> 
> In file included from /lhome/ghassan/fltk-1.1.0/FL/x.H:45,
>                  from /lhome/ghassan/fltk-1.1.0/FL/Fl_Image.H:29,
>                  from /lhome/ghassan/fltk-1.1.0/FL/Fl_Menu_Item.H:30,
>                  from /lhome/ghassan/fltk-1.1.0/FL/Fl_Menu_.H:32,
>                  from /lhome/ghassan/fltk-1.1.0/FL/Fl_Menu_Bar.H:29,
>                  from
> /lhome/ghassan/Insight-build/Auxiliary/MetaImage/IView/IViewGUIBase.h:9,
>                  from
> /lhome/ghassan/Insight-build/Auxiliary/MetaImage/IView/IViewGUIBase.cxx:3:
> /usr/X11R6/include/X11/Xutil.h:358: use of `Region' is ambiguous
> /usr/X11R6/include/X11/Xutil.h:233:   first declared as `typedef struct
> _XRegion *Region' here
> /lhome/ghassan/Insight/Code/Common/itkRegion.h:57:   also declared as `class
> itk::Region' here
> /usr/X11R6/include/X11/Xutil.h:358: `Region' denotes an ambiguous type
> /usr/X11R6/include/X11/Xutil.h:358: confused by earlier errors, bailing
> out
> make[7]: *** [IViewGUIBase.o] Error 1
> make[6]: *** [default_target] Error 2
> make[5]: *** [default_target_IView] Error 2
> make[4]: *** [default_target] Error 2
> make[3]: *** [default_target_MetaImage] Error 2
> make[2]: *** [default_target] Error 2
> make[1]: *** [default_target_Auxiliary] Error 2
> make: *** [default_target] Error 2
> 
> ______________________________________________________________________ 
> Post your free ad now! http://personals.yahoo.ca
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
> 
>