You could simply use M_PI from the <math.h> include (there are other constants too).
A direct solution toEdit: your question would besetup is correct. I got a working minmal example:
globals.h:
extern double g_pi;g_tst; globals.ccpp
g_pi#include "globals.h" double g_tst = 34.;0; For all other .c and main.h files:cpp
extern#include double"globals.h" #include g_pi;<stdio.h> #include <stdlib.h> int main() { fprintf (stderr, "g_tst = %lf \n", g_tst); return 0; } Also seeThe problem is within your buildsystem
See wikipedia