Error:identifier tgamma is undefined in c++ although <math.h> is included

1.2k views Asked by At

Im trying to use tgamma function in c++ 10.It's running on a 32-bit machine. I've included , but still getting the error "identifier tgamma is undefined ". what could be the reason?

2

There are 2 answers

0
eerorika On BEST ANSWER

The reason why you cannot use tgamma is because your compiler doesn't support the standard in which it was introduced. You'll need to use a compiler / standard library that does support c++11 or use another implementation of tgamma as advised in an answer to in a similar question What to do if tgamma() function is not defined? which Resource kindly linked for you.

4
Resource On

math.h is C. Try this instead:

#include <cmath>