Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Jul 1996 18:27:45 -0400
From:      Rick Weldon <rick@wisetech.com>
To:        Michael Searle <searle@longacre.demon.co.uk>
Cc:        questions@freefall.freebsd.org
Subject:   Re: C libraries
Message-ID:  <31DD96E1.2781E494@wisetech.com>
References:  <mE9178E39@longacre.demon.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Michael Searle wrote:

> #cc sqrt.c -o sqrt
> /var/tmp/cc0002661.o: Undefined symbol '_sqrt' referenced from text segment

You need to link in the math library. Add -lm

# cc sqrt.c -o sqrt -lm 

should do it.

I guess on the other machine your mentioned the math routines are in libc or the math lib is
automagically searched.

Rick



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?31DD96E1.2781E494>