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

Yipkei Kwok ykwok2 at miners.utep.edu
Thu Aug 23 12:40:46 EDT 2012


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
>



More information about the Disksim-users mailing list