One way:
#include <math.h>
Then use M_PI for the value in your code instead of PI, or you could add this line also:
#define PI M_PI
Another way:
#define PI 3.1415926535897932
One could also use compile option -D to get it defined.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!