make

Hi,
I want to run make for a "network packet trace reader" which is written in C.
In ubuntu 14.0.4

but I got this error: undefined reference to 'sqrt'

By using -lm ( > make -lm), I got that error again.
What should I do?

Thank you.


You could try make LDLIBS=-lm. It might work, but it depends on how the makefile has been written. If that doesn't work it might be easier to just open up the makefile and edit it manually.
Last edited on
Running make LDLIBS=-lm , I got the same error.

Then I added this line LDLIBS = -lm to makefile. And again the same error!


makefile:
CC = gcc
CFLAG = -wall -03 -c -g
LDLIBS = -lm
...
If the library that you're trying to build is Netrace I think you might have better luck with make LIBS=-lm.
Thank you very much. The solution works...
Last edited on
Registered users can post here. Sign in or register to post.
  • 1007451581 2018-02-22
  • 8908121580 2018-02-22
  • 141161579 2018-02-22
  • 9421578 2018-02-22
  • 2826901577 2018-02-22
  • 3647361576 2018-02-22
  • 5717551575 2018-02-22
  • 523811574 2018-02-22
  • 6439871573 2018-02-22
  • 8109431572 2018-02-22
  • 8757321571 2018-02-22
  • 5265111570 2018-02-22
  • 3351351569 2018-02-22
  • 5109361568 2018-02-22
  • 4455391567 2018-02-22
  • 9091121566 2018-02-22
  • 24791565 2018-02-22
  • 2486841564 2018-02-21
  • 9847231563 2018-02-21
  • 9264681562 2018-02-21