EpsilonVector
EpsilonVector

Reputation: 4043

Is the math library linked statically?

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

Answers (1)

Šimon Tóth
Šimon Tóth

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

Related Questions