[Insight-users] compiling ITK with gcc 3.2?

Luis Ibanez luis.ibanez@kitware.com
Wed, 16 Oct 2002 09:41:07 -0400


Hi Harri,

Good to know that the VCL_NEEDS_INLINE_INSTANTIATION
declaration must be different for gcc 3.2. We probably
can setup this on the main CMakeLists.txt file.


The new errors seem to be a linking problem.

The itkNumericsHeaderTest is pretty simple. It only
includes all the headers in the Insight/Code/Numerics
directory.  The intent is to verify tha the headers
can pass a simple syntax check.

Did you try cleaning the binary directory ?



    Luis


=========================================

Harri Tapio Jaalinoja wrote:

> Hi,
> 
> with the vnl_matrix+double-.cxx looking like this...
> 
> -- clip --
> template class vnl_matrix<double >;
> template vnl_matrix<double > operator-(double const &, vnl_matrix<double > const &);
> VCL_INSTANTIATE_INLINE(vnl_matrix<double > operator+(double const &, vnl_matrix<double > const &));
> VCL_INSTANTIATE_INLINE(vnl_matrix<double > operator*(double const &, vnl_matrix<double > const &));
> template double dot_product(vnl_matrix<double > const &, vnl_matrix<double > const &);
> template double inner_product(vnl_matrix<double > const &, vnl_matrix<double > const &);
> template double cos_angle(vnl_matrix<double > const &, vnl_matrix<double > const &);
> template vnl_matrix<double > element_product(vnl_matrix<double > const &, vnl_matrix<double > const &);
> template vnl_matrix<double > element_quotient(vnl_matrix<double > const &, vnl_matrix<double > const &);
> template int vnl_inplace_transpose(double*, unsigned, unsigned, char*, unsigned);
> template vcl_ostream & operator<<(vcl_ostream &, vnl_matrix<double > const &);
> template vcl_istream & operator>>(vcl_istream &, vnl_matrix<double >       &);
> VCL_INSTANTIATE_INLINE(bool operator!=(vnl_matrix<double > const &, vnl_matrix<double > const &))
> -- clip --
> 
> ... the error comes from the last line.
> 
> I can get over this by using the trick pointed out by Koen, setting
> #define VCL_NEEDS_INLINE_INSTANTIATION 0
> in Build/Code/Numerics/vxl/vcl/vcl_config_compiler.h
> 
> However, now I encounter this error:
> 
> itkNumericsHeaderTest.o: In function
> `__static_initialization_and_destruction_0(int, int)':
> itkNumericsHeaderTest.o(.text+0x36): undefined reference to
> `std::ios_base::Init::Init[in-charge]()'
> itkNumericsHeaderTest.o: In function `__tcf_0':
> itkNumericsHeaderTest.o(.text+0x65): undefined reference to
> `std::ios_base::Init::~Init [in-charge]()'
> itkNumericsHeaderTest.o(.eh_frame+0x11): undefined reference to
> `__gxx_personality_v0'
> collect2: ld returned 1 exit status
> make[7]: ***
> [/home/hajaalin/Insight_CVS/Insight/Build/bin/itkNumericsHeaderTest] Error
> 1
> make[6]: *** [default_target] Error 2
> make[5]: *** [default_target_Numerics] Error 2
> make[4]: *** [default_target] Error 2
> make[3]: *** [default_target_Code] Error 2
> make[2]: *** [default_target] Error 2
> make[1]: *** [default_target_Testing] Error 2
> make: *** [default_target] Error 2
> 
> 
> Making good progress, but not quite there yet :)
> 
> Thanks,
> Harri
> 
> 
> On Tue, 15 Oct 2002, Luis Ibanez wrote:
> 
>