Nov 19, 2017 at 1:24pm UTC
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.
Nov 19, 2017 at 1:47pm UTC
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 Nov 19, 2017 at 1:48pm UTC
Nov 19, 2017 at 5:19pm UTC
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
...
Nov 19, 2017 at 6:32pm UTC
If the library that you're trying to build is Netrace I think you might have better luck with make LIBS =-lm
.
Nov 19, 2017 at 6:48pm UTC
Thank you very much. The solution works...
Last edited on Nov 19, 2017 at 6:51pm UTC