Brian Keener wrote:
>Robert Osfield wrote:
>
>
>>The errors don't make any sense to me, the line is:
>>
>>
>>inline float log2(float v) { return logf(v) * static_cast<float>(INVLN_2);
>>
>>
>}
>
>
>>And the error you get is:
>>
>>/usr/src/OpenSceneGraph/include/osg/Math:197: error: expected `)'
>>before '/' token
>>/usr/src/OpenSceneGraph/include/osg/Math:197: error: expected `,' or
>>`;' before '/' token
>>
>>It's like the compiler is treating the definition of INVLN_2 as a
>>macro not a const double. The definition of INVLN_2 is near the top
>>of include/osg/Math :
>>
>>const double LN_2 = 0.69314718055994530942;
>>const double INVLN_2 = 1.0 / LN_2;
>>
>>This really looks like a bug in the compiler. Perhaps changing the
>>above be a hardwired value i.e. const double INVLN_2 = 1.442... might
>>get around this bug, could you try this?
>>
>>Robert.
>>
>>
>
>I tried the change you suggested but no go. I think it might be deeper in
>/usr/include/math.h where they do a define on log2 and log2f as follows
>but....
>
>#define log2(x) (log(x) / M_LOG2_E)
>#define log2f(x) (logf(x) / (float) M_LOG2_E)
>
>not sure.
>
>
If there is a way to display the compile command that cmake is executing
in this case, then you could try to add the -E switch to that command,
so that the preprocessed output can be inspected.
This should probably help in identifying what is going on.
Paul
>bk
>
>
>
>_______________________________________________
>osg-users mailing list
>[email protected]
>http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org