Including non-ansi functions from <math.h> in compiled UDFs

The Fluent makefile uses the 'ansi' flag which excludes certain library functions, e.g. the error function in <math.h>. You will get a compiler warning 'implicit declaration' if you try to use such a function. You will end up with a function returning int, regardless of the definition (i.e. in most cases total nonsense).

You can use these functions by declaring them explicitly in your source file:

double erf(double);

This will lead to a useable error function (of course, it has to be defined in your library, which is platform dependent).

Show Form
No comments yet. Be the first to add a comment!