[Disksim-users] disksim compile error undefined reference to `sqrt

孙龙 nianglao at gmail.com
Thu Aug 23 22:34:11 EDT 2012


 "adjust the appearance  of the "-lm" parameter to be the last parameter".
It works. Thank you for your help.

2012/8/24 Yipkei Kwok <ykwok2 at miners.utep.edu>

> 2 things that you may want to check
>
> 1. sqrt() may require the math.h header. Does the C file include the
> header?
> 2. Is your libm.a in a non-standard location? If yes, you need to use
> the gcc flag -L to indicate the location of the library
>
> Good luck. Hope it helps.
>
> On Thu, Aug 23, 2012 at 10:24 AM, 孙龙 <nianglao at gmail.com> wrote:
> > Hi all, I met the same problem as
> >
> https://sos.ece.cmu.edu/pipermail/disksim-users/2011-December/000699.html.
> > But I didn't find any solutions. Can anyone help me?
> >
> >
> > "Hi all,
> >
> > I'm trying to compile the DiskSim 4.0 and have the following error:
> >
> > "...memsmodel/mems_piecewise_seek.c:524: undefined reference to `sqrt'"
> >
> > and so on... (see the log file)
> >
> > It seems to be a problem with the mathlib link, however I've check in
> > the makefile, and there is all ok (i.g. gcc -lm ...).
> >
> > I'm actually not very familar with C/C++ and linux systems, so I'm in
> > trouble :)"
> >
> >
> > _______________________________________________
> > Disksim-users mailing list
> > Disksim-users at ece.cmu.edu
> > https://sos.ece.cmu.edu/mailman/listinfo/disksim-users
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/disksim-users/attachments/20120824/133e5f5b/attachment.html>


More information about the Disksim-users mailing list