Reputation: 4043
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?
Upvotes: 3
Views: 1583
Reputation: 36433
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.
Upvotes: 5