0

Possible Duplicate:
Why Am I Getting Link Errors When Calling Function in Math.h?

Hello, I have a problem in C (gcc), when I compile a program that includes Math.h and uses functions from there, it says "undefined reference to...". it happens for sqrt, log, but for others not (for instance pow). How can I fix this library or reinstall it ? thanks in advance. [I am using Ubuntu]

Community
  • 1
  • 1
shkk
  • 313
  • 1
  • 3
  • 4

1 Answers1

2

You shold link with -lm option: gcc -o test test.c -lm lm means link math.

Mariy
  • 5,746
  • 4
  • 40
  • 57