Is the math library statically linked?

I got the impression that the math library is linked statically because it -l namerefers to libname.a, however, if I try to compile a flag -static, suddenly GCC will not be able to find math functions.

Does this mean that math is not necessarily statically related? Or is something else happening here?

+3
source share
1 answer

If it compiles statically, you should write gcc libname.ainstead gcc -l libname.

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

+5
source

All Articles