[gmx-developers] How to include <math.h> when Adding code in md.c

Erik Marklund erikm at xray.bmc.uu.se
Tue Mar 29 10:47:10 CEST 2011


Yukun Wang skrev 2011-03-29 10.19:
> Hi all:
>
>      I add some code in the end of md.c, in which I called a function 
> "sqrt()", and at the start of md.c I add: #include <maths.h>.
>      As you know "sqrt()" is an often used function in the mathlib of 
> C, however, when I complie this code, system give an error:
>
>
> md.c:3011: error: `squr' undeclared (first use in this function)
> md.c:3011: error: (Each undeclared identifier is reported only once
> md.c:3011: error: for each function it appears in.)
> make[3]: *** [md.o] Error 1
>
> I guess I included a wrong mathlib headfile,is there anyone can tell 
> me when Gromacs itself need to extract a root which headfile was included?
>
Check your spelling. Twice. Don't include "maths.h", and don't call 
"squr". It's "math.h" and "sqrt".

-- 
-----------------------------------------------
Erik Marklund, PhD student
Dept. of Cell and Molecular Biology, Uppsala University.
Husargatan 3, Box 596,    75124 Uppsala, Sweden
phone:    +46 18 471 4537        fax: +46 18 511 755
erikm at xray.bmc.uu.se    http://folding.bmc.uu.se/




More information about the gromacs.org_gmx-developers mailing list