make

Nov 19, 2017 at 1:24pm
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
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
Nov 19, 2017 at 5:19pm
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
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
Thank you very much. The solution works...
Last edited on Nov 19, 2017 at 6:51pm
Topic archived. No new replies allowed.