[Insight-users] ITK from cvs compiled fine with gcc version 3.3.1 but not with gcc version 3.4.1

Rao Jianguo rao.jianguo at hgu.mrc.ac.uk
Mon Dec 20 11:12:07 EST 2004


Hi Jens,


I already overcome  that kind of error by simply
change the member function in itkEventObject.h
classname(const Self&) from private to public

The next error I hit is:

when compile

c++ -o itkOctreeNode.o -DITKCommon_EXPORTS -fpermissive  
-ftemplate-depth-50 -fPIC  ...

I got

In file included from 
/export/data0/home/ITK/Insight/Code/Common/itkOctree.h:22,
                 from 
/export/data0/home/ITK/Insight/Code/Common/itkOctreeNode.cxx:10:
/export/data0/home/ITK/Insight/Code/Common/itkImage.h: In member 
function `bool itk::Image<TPixel, 
VImageDimension>::TransformPhysicalPointToContinuousIndex(const 
itk::Point<TCoordRepB, NPointDimension>&, 
itk::ContinuousIndex<TCoordRep, VImageDimension>&) const':
/export/data0/home/ITK/Insight/Code/Common/itkImage.h:289: error: 
`m_Origin' undeclared (first use this function)
/export/data0/home/ITK/Insight/Code/Common/itkImage.h:289: error: (Each 
undeclared identifier is reported only once for each function it appears 
in.)
/export/data0/home/ITK/Insight/Code/Common/itkImage.h:289: error: 
`m_Spacing' undeclared(first use this function)
/export/data0/home/ITK/Insight/Code/Common/itkImage.h: In member 
function `bool itk::Image<TPixel, 
VImageDimension>::TransformPhysicalPointToIndex(const 
itk::Point<TCoordRepB, NPointDimension>&, typename 
itk::ImageBase<VImageDimension>::IndexType&) const':
/export/data0/home/ITK/Insight/Code/Common/itkImage.h:313: error: 
`m_Origin' undeclared (first use this function)
/export/data0/home/ITK/Insight/Code/Common/itkImage.h:313: error: 
`m_Spacing' undeclared(first use this function)
/export/data0/home/ITK/Insight/Code/Common/itkImage.h: In member 
function `void 
itk::Image<TPixel,VImageDimension>::TransformContinuousIndexToPhysicalPoint(const 
itk::ContinuousIndex<TCoordRep, VImageDimension>&, 
itk::Point<TCoordRepB, NPointDimension>&) const':
/export/data0/home/ITK/Insight/Code/Common/itkImage.h:334: error: 
`m_Spacing' undeclared(first use this function)
/export/data0/home/ITK/Insight/Code/Common/itkImage.h:334: error: 
`m_Origin' undeclared (first use this function)
/export/data0/home/ITK/Insight/Code/Common/itkImage.h: In member 
function `void itk::Image<TPixel, 
VImageDimension>::TransformIndexToPhysicalPoint(const typename 
itk::ImageBase<VImageDimension>::IndexType&, itk::Point<TCoordRepB, 
NPointDimension>&) const':
/export/data0/home/ITK/Insight/Code/Common/itkImage.h:350: error: 
`m_Spacing' undeclared(first use this function)
/export/data0/home/ITK/Insight/Code/Common/itkImage.h:351: error: 
`m_Origin' undeclared (                   first use this function)

More tips ?

Thanks

Jens Fisseler wrote:

>Hi everbody!
>
>  
>
>>>ITK is not compatible with gcc 3.4 yet. Please use gcc 3.3 or you can 
>>>add the -permissive flag to the compiler flags and that should do it 
>>>(hopefully). Otherwise, Bill is in the process of updating ITK to 
>>>compile with gcc 3.4, it's a long process, just be patient :)
>>>      
>>>
>
>The problems with compiling ITK with gcc-3.4 go deeper than just using
>the -permissive flag. I just stumbled over them myself.
>
>The 'EventObject'-Class and its subclasses all have private copy
>constructors, which is what the compiler is complaining about. Now every
>time an event is invoked, 'itk::Object::InvokeEvent()' is called with a
>constant reference parameter which is initialised with an anonymous
>object, like this:
>
>this->InvokeEvent( StartEvent() );
>
>This is the first line from 'itk::AmoebaOptimizer::StartOptimization()',
>and it worked with previous versions of the g++, but g++-3.4 is much
>closer to conformance to the ISO/ANSI C++ standard, which is why the
>copy constructor must be accessible (see
>http://gcc.gnu.org/bugs.html#cxx_rvalbind for details).
>
>You could also use the following code:
>
>itk::StartEvent startEvent;
>this->InvokeEvent(startEvent);
>
>I hope this clarifies some of the error messages you get when compiling
>ITK with g++-3.4.
>
>Regards,
>
>	Jens
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>  
>



More information about the Insight-users mailing list