[Insight-users] typedef name cannot follow class/struct/union

Dan Mueller dan.muel at gmail.com
Mon Feb 1 01:01:44 EST 2010


Hi Neil,

Hmm... This error seems strange. Where exactly is the typedef defined?
Maybe you could a bit more of the code to help us diagnose the
problem.

Visual Studio is known to behave differently when the typename keyword
is used *within* the template definition. In that case you can replace
"typename" with "ITK_TYPENAME". This macro is defined in
Code/Common\/itkWin32Header.h (see below). Not sure if this will help
in this case, but perhaps worth a shot...

// typename keyword in default template arguments is not accepted by
// MSVC.  This macro should only be used in such places.
# if !defined(CABLE_CONFIGURATION) && (_MSC_VER < 1310)
#  define ITK_TYPENAME
# else
#  define ITK_TYPENAME typename
# endif
#else
# define ITK_TYPENAME typename
#endif

Cheers, Dan

On 1 February 2010 05:39,  <Neil.Burdett at csiro.au> wrote:
> Hi,
>
>     I am currently porting an application from Ubuntu to windows. The line
> of code below compiles on Ubuntu but not on visual studio...
>
>
>
>   typedef typename itk::UltimateSkeletonImageFilter<TOutputImage,
> TOutputImage, itk::Connectivity<Dimension, 0>, DistanceImageType >
> SeedSkeletonFilterType;
>
>
>
> I receive the error in visual studio 2008 “error C2242: typedef name cannot
> follow class/struct/union”
>
>
>
> Any help would be appreciated.
>
>
>
> Neil


More information about the Insight-users mailing list