[Insight-developers] Sun Compiler

Miller, James V (Research) millerjv at crd.ge.com
Fri Nov 5 10:06:44 EST 2004


If I recall correctly from 5 years ago, the Sun compiler never 
liked classes templated over integers (e.g. like how we specify 
the dimension of an image or vector).

When we did the Borland compiler, it didn't like specifying the 
dimensions (of internal types/typedefs) based on enums (which were
derived from template parameters).  

Jim



-----Original Message-----
From: William A. Hoffman [mailto:billlist at nycap.rr.com]
Sent: Friday, November 05, 2004 9:07 AM
To: Lorensen, William E (Research); insight-developers at itk.org
Subject: RE: [Insight-developers] Sun Compiler


I don't think this has anything to do with INCLASS member initialization.
It is this line that causes the problem:  CoordRepType[PointDimension]
There are no defines on that line.  The problem is that it does not think
PointDimension is an int.   If you use the template parameter
VPointDimension
it works.

-Bill

At 07:25 AM 11/5/2004, Lorensen, William E (Research) wrote:
>In itkMacro.h these is code:
>
>#if defined(_MSC_VER) && (_MSC_VER <= 1300) 
>#   define ITK_NO_INCLASS_MEMBER_INITIALIZATION
>#endif
>#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x540)
>#   define ITK_NO_INCLASS_MEMBER_INITIALIZATION
>#endif
>#if defined(__SVR4) && !defined(__SUNPRO_CC)
>#   define ITK_NO_INCLASS_MEMBER_INITIALIZATION
>#endif
>
>Looks like some magic may be required for the sun compiler. Can you check
to
>see if the define is being executed for the native sun compiler. If so,
>maybe it should not be?
>
>Bill
>
>-----Original Message-----
>From: William A. Hoffman [mailto:billlist at nycap.rr.com]
>Sent: Thursday, November 04, 2004 10:09 PM
>To: insight-developers at itk.org
>Subject: [Insight-developers] Sun Compiler
>
>
>We have a new sun at Kitware and I thought I would give the native compiler
>a go.
>Here are the errors:
>
>http://www.itk.org/Testing/Sites/dashsun1/SunOS-CC/20041104-2212-Experiment
a
>l/BuildError.html
>
>The majority of errors come from this type of thing:
>
>"/.../Insight/Code/Common/itkPointSet.txx", line 299: Error: An integer
>constant expression is required within the array subscript operator.
>1 Error(s) detected.
>*** 
>
>template <typename TPixelType, unsigned int VDimension, typename
>TMeshTraits>
>bool
>PointSet<TPixelType, VDimension, TMeshTraits>
>::FindClosestPoint(CoordRepType[PointDimension],
>                   PointIdentifier*)
>{
>
>The compiler does not like PointDimension, but if you change it to
>VDimension it compiles.
>Is this some sort of strange thing for the borland compiler?
>
>-Bill
>
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers at itk.org
>http://www.itk.org/mailman/listinfo/insight-developers
>_______________________________________________
>Insight-developers mailing list
>Insight-developers at itk.org
>http://www.itk.org/mailman/listinfo/insight-developers 

_______________________________________________
Insight-developers mailing list
Insight-developers at itk.org
http://www.itk.org/mailman/listinfo/insight-developers


More information about the Insight-developers mailing list