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
Topic archived. No new replies allowed.