Is the math library linked statically?

c, gcc, libraries, static-linking

Solution

If it would compile statically you would write `gcc libname.a` instead of `gcc -l libname`.

And to your question, yes math library is linked dynamically.

Problem

I was under the impression that the math library is linked statically because `-l name` links to `libname.a`, however if I try to compile with the `-static` flag, suddenly GCC can't find the math functions. Does this means that math is not necessarily linked statically? Or is something else is going on here?

Original source