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

Jens Fisseler fisseler at rob.uni-luebeck.de
Mon Dec 20 10:49:21 EST 2004


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



More information about the Insight-users mailing list