On 2012/6/5 Gernot wrote:
> Hi all,
> I used OpenCascade some time ago and recently switched over to use
> OCE, just because its much easier installation procedure. I do not
> know whether there is a special place to discuss OCE so I will ask my
> first question here. Please tell me if this is not the right place.
This is the right place.
> In my source code I use a macro? PI which worked with last versions of
> OCE. Now I installed oce-0.9.1-67 and got a compiler message that PI
> was not defined.
PI used to be defined in Standard_Real.hxx, but OpenCascade switched
to the standardized M_PI macro, defined in math.h.
> Unfortunately I do not understand completely the C++ basics around a
> construct like this PI. I remember its a macro that is translated
> during compilation into the value 3.14... Could someone be so nice to
> explain to me how this works or how I can realize an exact value for
> PI allover my program? Is there a special OpenCascade replacement for
In your C++ files, you can replace all occurences of PI by M_PI (and
#include <math.h>), or write something like:
# include <math.h>
# define PI M_PI