Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Oct 1998 12:06:11 -0600 (CST)
From:      Jeffrey Lynn Jeffries <jeffries@ns1.schleprock.com>
To:        Steve Friedrich <SteveFriedrich@Hot-Shot.com>
Cc:        Brendan Kosowski <brendan@bmk.com.au>, FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Problem with C compile on FreeBSD 2.2.5
Message-ID:  <Pine.BSI.4.05L.9810251204210.7439-100000@ns1.schleprock.com>
In-Reply-To: <199810251552.KAA10734@laker.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> >The C compiler on FreeBSD 2.2.5 will not let me comile an ANSI-C program
> >that works fine on other ANSI-C compilers.
> >
> >The problem is with the trig. functions ( ie. sin, asin, etc... ).
> >
> >It says something like undefined symbol "_sin" referenced from text
> >segment.
> >
> >I have included <math.h>.

When you compile with the math library, you must specifically link the
math library as well, i.e.:
   gcc mathprog.c -lm

==========================================================================
   Jeffrey Lynn Jeffries
   Chief Software Engineer, Missing Link Media

   jeffries@schleprock.com
   http://www.schleprock.com/~jeffries

   Proud user of FreeBSD: Ask me how to unleash the daemon inside your PC


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.BSI.4.05L.9810251204210.7439-100000>