To: Mike Piff Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: Simple problems Date: Fri, 11 Mar 94 11:16:40 -0500 From: Mike Collison > Why will the following not work? (My first use of maths with C and my second > ever use of C!) The linker says there is an unresolved reference to sqrt?? > #include > int x; > main(){ > x=sqrt(2.0); > } > (OK, I know x should be float!) Add a '-lm' on the command line. The linker does not search the math library by default. Mike