sqrt(x)

Wolfgang Formann wfor@arcor.de
Sun May 15 16:11:00 GMT 2005


tobaccofarm wrote:
> However the compiler gave the following error messages:
> 
> sqrt.c:15:2: warning: no newline at end of file
> /tmp/ccCL96r1.o(.text+0x4d): In function `main':
> sqrt.c: undefined reference to `pow'
> /tmp/ccCL96r1.o(.text+0x80):sqrt.c: undefined reference to `sqrt'
> /tmp/ccCL96r1.o(.text+0xc0):sqrt.c: undefined reference to `pow'
> collect2: ld returned 1 exit status

No, it was the linker.
No, you are on the wrong list.
Yes, try out -lm, then it should work.

Wolfgang



More information about the Gcc-help mailing list