This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: sqrt(x)
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