[Insight-developers] compiling ITK with gcc 4.3

Casey Goodlett gcasey at sci.utah.edu
Thu Apr 3 15:45:22 EDT 2008


The error I got was for example in itk::Neighboorhood

/home/gcasey/research/itk/Insight/Code/Common/itkNeighborhood.h:154:
error: declaration of 'unsigned int itk::Neighborhood<TPixel,
VDimension, TAllocator>::Size() const'
/home/gcasey/research/itk/Insight/Code/Common/itkSize.h:46: error:
changes meaning of 'Size' from 'class itk::Size<VDimension>'

The problem is that the new gcc enforces having duplicate names in the
same class being an error.  In the neighboordhood class itk::Size is
used and there is also a function named Size().  This generates an
error if the Size class is not qualified with itk.    This is
described in the "name lookup changes" section of the porting document
Sean mentioned http://gcc.gnu.org/gcc-4.3/porting_to.html  Also having
a typedef of a templated type to its own name without a template

typedef Size<3> Size;

is now enforced as an error.

Casey

On Thu, Apr 3, 2008 at 3:18 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Casey,
>
>  I am surprised that yoiu had to add itk:: to a number of type? What
>  errors do you get if you don't add the itk::?
>
>  Bill
>
>
>
>  On Thu, Apr 3, 2008 at 2:33 PM, Casey Goodlett <gcasey at sci.utah.edu> wrote:
>  > Thanks,
>  >
>  > I got around to fixing all the problems in my compilation using the
>  > page you mentioned.  I posted a patch in the bug database here
>  > http://www.itk.org/Bug/view.php?id=6699 which gets compilation to work
>  > for me.  If someone could take a look at the patch that would be
>  > great.
>  >
>  > Casey
>  >
>  >
>  > On Thu, Apr 3, 2008 at 10:47 AM, Sean McBride <sean at rogue-research.com> wrote:
>  > > On 3/31/08 4:38 PM, Casey Goodlett said:
>  > >
>  > >  >Has anyone tried building ITK with gcc 4.3?  I'm currently attempting
>  > >  >this but running into a substantial number of compilation errors.  I
>  > >  >just wanted to check if someone else is working on this before working
>  > >  >on it too much
>  > >
>  > >  I haven't (though I've succeeded with Apple's beta version of their fork
>  > >  of gcc 4.2).
>  > >
>  > >  The following guide may help:
>  > >  <http://gcc.gnu.org/gcc-4.3/porting_to.html>
>  > >
>  > >  --
>  > >  ____________________________________________________________
>  > >  Sean McBride, B. Eng                 sean at rogue-research.com
>  > >  Rogue Research                        www.rogue-research.com
>  > >  Mac Software Developer              Montréal, Québec, Canada
>  > >
>  > >
>  > _______________________________________________
>  > Insight-developers mailing list
>  > Insight-developers at itk.org
>  > http://www.itk.org/mailman/listinfo/insight-developers
>  >
>


More information about the Insight-developers mailing list