🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: crl.general
Article #10

Re: Problem with C for the mathematical programm

#10
From: P.Bennett
Date: Fri, 02 Feb 1996 05:59
35 lines
1865 bytes
In article <4erfj5$f5c@canb.cin.gov.au>, rossw@cin.gov.au (Ross Wilson) writes...
>sorkin@crl.com (Iouri Sorkine) wrote:

>>I execute "cc name.c" and receive "ld: Undefined symbol
>>                                       _cos
>>                                       _sin
>>and so on...                                ". 
>>What's wrong?        

>You will need to include the math library.  How you do this depends on
>what operating system and/or compiler you are using.

>If you use UNIX, do:
> 
>	cc -lm name.c

Although I don't do unix, I've seen this often enough to know that libraries
_must_ be listed at the _end_ of the command line:
	cc name.c -lm
> 
>If you use Borland, Microsoft, whatever, you will have to read the
>manual.

Borland and Microsoft very nicely put the math functions in the main library,
so you don't have to worry about this nonsense - MS-DOS _does_ have some
advantages  :-)

>Don't forget to #include <math.h>.


Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight
Internet: bennett@triumf.ca         | of one another only when one can be
Packet: ve7cei@ve7kit.#vanc.bc.ca   | observed visually from the other
TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
Technical Details
Message-ID: <1FEB199621595021@erich.triumf.ca>
Path: arc1-ca.pugleaf.net!erich.triumf.ca!bennett
References: <4epq2e$h4b@crl2.crl.com> <4erfj5$f5c@canb.cin.gov.au>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!erich.triumf.ca!bennett
From: bennett@erich.triumf.ca (P.Bennett)
Newsgroups: crl.general,comp.sys.sun.misc,comp.unix.sys5.misc,comp.lang.c,sci.math
Subject: Re: Problem with C for the mathematical programm
Date: 1 Feb 1996 21:59 PST
Organization: TRIUMF: Tri-University Meson Facility
Distribution: world
Message-ID: <1FEB199621595021@erich.triumf.ca>
References: <4epq2e$h4b@crl2.crl.com> <4erfj5$f5c@canb.cin.gov.au>
NNTP-Posting-Host: ftp.triumf.ca
News-Software: VAX/VMS VNEWS 1.50