If you're using C++ rather than C, you should #include <cmath> instead.
#define NUM_OF_ELEMENTS 20000
Another hangover from C. In C++ the following is more idiomatic:
const int numElements = 20000;
double long pi = 0;
I'm more used to seeing it written as "long double".
for (long int n = 1; n <= NUM_OF_ELEMENTS; n++)
An int would suffice for at least 32767 elements on all platforms, and on most of today's platforms at least 2147483647, so no need for long int.
I think the error message gives you a good clue as to what is wrong here. pow requires two arguments. You are only passing one. The ^ operator does not mean "raise to the power of". It means "bitwise exclusive or". Something completely different to what you want to do.
You should also think about performance. The pow function is typically implemented by taking the logarithm, multiplying by the power and taking the antilogarithm of the result. That is very time-consuming for the very simple purpose you are putting it to, which is to alternate the sign of each term in your sequence.
This would only work on DOS or Windows. What if you tried your application on Linux or Solaris?
Finally, there is a "cheat" to make the result more accurate: add only half of the last term. (This trick only works for terms with alternating signs, like this one.)