On 1/17/07, <b class="gmail_sendername">Dennis Jen</b> <<a href="mailto:dsjen@nmr.mgh.harvard.edu">dsjen@nmr.mgh.harvard.edu</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br> When I upgraded from ITK 2.6.0 to 3.0.0, I got a compile error in a<br>filter I was working on. It looks like the itkStaticConstMacro is only<br>valid for the integer type now. This line:<br><br> itkStaticConstMacro( DEFAULT_REPLICA_EXCHANGE_PROBABILITY, double,
0.05 )<br><br>causes the following error:<br><br>MY_PATH/itkPoistatsFilter.h:375: error: enumerator value for<br>`DEFAULT_REPLICA_EXCHANGE_PROBABILITY' not integer constant</blockquote><div><br>itkStaticConstMacro should be used only for "unsigned int" and "int" as long as ITK supports
VS6.0, gcc <= 2.95. The change that was made to itkMacro prompting your error enforced it for all gcc compilers regardless of whether it was allowed.<br><br>The point is that itkStaticConstMacro uses a "static const" on a few compilers and an "enum" on those where the former doesn't work. And enum's are integer enumerations.
<br><br>So in the interest of portability please do not use itkStaticConstMacro for doubles. Just do<br><br> static const double DEFAULT_REPLICA_EXCHANGE_PROBABILITY = 0;<br><br>Thanks<br>-karthik<br> </div></div>