Question

I am trying to use tgamma() from the standard library. When I try to compile, I get the error message:

Call to undefined function tgamma

I have the directive #include <cmath>. I use Embarcadero C++ Builder XE3, which claims to support C++11 standards. What could be my problem, and how to fix it?

Was it helpful?

Solution

Boost contains a tgamma function.

#include <boost/math/special_functions/gamma.hpp>
...
double rootPi = boost::math::tgamma<double>(0.5);

Of course, you can always switch to a different compiler, like gcc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top