I am working with the Borland Turbo C++ compiler in a WINDOWS machine, and wrote a piece of code in C.
I want to use the complementary error function erfc() for one of my calculations.
However, when I run the code, the error is
“Linker error: Undefined symbol _erfc in in module filename.c “
The problem here is erfc() and erf() are supposed to be included in the math.h library.
However, these aren’t available in mine.
Can anyone please tell me how I can include these functions in my program ?
Thank you
It’s likely that you need to pass some special option to link to the math library.
It’s also possible that Borland Turbo C++ doesn’t support the
erfc()function.In C, the 1990 ISO C standard didn’t include the
erfc()function. It was added to the language by the 1999 standard. (I’m not sure about C++.) I think that Borland Turbo++ is fairly old.Try writing a small program that calls
sqrt(). If you can get that to work, anderfc()is still unrecognized, then Borland doesn’t support it.In the latter case, either get a newer compiler (there are a number of free ones, and that’s probably a good idea in any case), or find an open source implementation of
erfc().