[Insight-developers] Sun Compiler

William A. Hoffman billlist at nycap.rr.com
Fri Nov 5 11:03:26 EST 2004


OK, I tried the static const thing and it still did not really work.
I think the problem is mainly of scope.  It would seem that the current CC
on the sun supports int template parameters.  However, it seems to have
some different scope rules.   

// compiles:
::FindClosestPoint(CoordRepType[PointSet::PointDimension],
                   PointIdentifier*)

// does not compile, says you need an int 
::FindClosestPoint(CoordRepType[PointDimension],
                   PointIdentifier*)
 
-Bill


At 10:12 AM 11/5/2004, Lorensen, William E (Research) wrote:
>VPointDimension is not available in all of the places that are failing.
>
>-----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