Date: Sat, 6 Feb 1999 21:06:07 -0600 (CST) From: "Thomas T. Veldhouse" <veldy@visi.com> To: cjclark@home.com Cc: keith@apcs.com.au, questions@FreeBSD.ORG Subject: Re: math.h ? Message-ID: <Pine.GSO.4.02.9902062104560.5954-100000@isis.visi.com> In-Reply-To: <199902070050.TAA27981@cc942873-a.ewndsr1.nj.home.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Don't use test as your output binary.  There is a system program called
test, and if you have . in you path, you may not figure out why your
program is not working.
Tom Veldhouse
veldy@visi.com
On Sat, 6 Feb 1999, Crist J. Clark wrote:
> Keith Anderson wrote,
> > HI All,
> > 
> > Below I have a very simple 'c' program but I can't make it work !! What am I
> > doing wrong, it will not compile?
> > 
> > Any help would be great 
> > 
> > Thanks 
> > 
> > Keith
> > 
> > <snip test.c>
> > #include <math.h>
> > 
> > main ()
> > {
> > double x = 64;
> > double ans;
> > ans = sqrt(x);
> > 
> > printf("ans = %lf\n",ans);
> > 
> > }
> > 
> > </snip test.c>
> > 
> > keith@wis~>cc test.c
> > /var/tmp/ccV145121.o: Undefined symbol `_sqrt' referenced from text segment
> 
> Type,
> 
> % cc -lm test.c -o test
> 
> This includes the math libraries. It is standard accross most UNICies.
> -- 
> Crist J. Clark                           cjclark@home.com
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.02.9902062104560.5954-100000>
