[Insight-developers] MSVC 8 and native Sun compiler

Brad King brad.king at kitware.com
Wed Jul 20 09:16:58 EDT 2005


Julien Jomier wrote:
> Hi All,
> 
> I'm having an issue while trying to make ITK compile with MSVC 8 (beta 2).
> 
> The main issue is the different signatures for a function:
> 
> - in the .h
> void SetSpacing(const double spacing[ImageDimension])
> 
> - in the .txx/cxx
> ::SetSpacing(const double spacing[Self::ImageDimension] )    
> 
> The native sun compiler needs the Self:: in order to compile but there 
> is a bug in the MSVC 8 compiler so that it fails with:
> "error C2244: 'itk::ImageAdaptor<TImage,TAccessor>::SetSpacing' : unable 
> to match function definition to an existing declaration"
> 
> I think we have two options here:
> 1) Drop support for MSVC 8 beta 2 and hope that Microsoft will fix the 
> bug in the real release (a bug report has been submitted).
> 
> 2) Try to find a workaround (by using a macro?)
> 
> Let me know what you think,

Isn't this where we can use the static constant macros?

Otherwise just change the signature to

SetSpacing(const double* spacing /* [ImageDimension] */)

because array arguments are equivalent to pointers anyway.

-Brad


More information about the Insight-developers mailing list