🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: crl.general
Article #14

Re: Problem with C for the mathematical programm

#14
From: Guus Leeuw jr.
Date: Tue, 06 Feb 1996 16:31
23 lines
1340 bytes
sorkin@crl.com (Iouri Sorkine) wrote:
>
>I execute "cc name.c" and receive "ld: Undefined symbol
>                                       _cos
>                                       _sin
>and so on...                                ". 
>What's wrong?        
>
>Yuri Sorkin
>

Well, you forgot to link your math library.

You should be using `cc name.c -lm' if an executable image is that what you
want. If not, you should be using `cc -c name.c'.

The `-lxx' tells cc to tell the ld command to link `xx' to the executable image
aswell. The `-c' option tells cc to compile only (ie don't generate an
executable image).

Hope this helps,
	Guus Leeuw jr.
	guusl@eiffel.com
Technical Details
Message-ID: <4f7vp1$pmv@news.rain.org>
Path: arc1-ca.pugleaf.net!news.rain.org!usenet
References: <4epq2e$h4b@crl2.crl.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.rain.org!usenet
From: "Guus Leeuw jr." <guusl@eiffel.com>
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: 6 Feb 1996 16:31:29 GMT
Organization: Interactive Software Engineering Inc. http://www.eiffel.com/
Message-ID: <4f7vp1$pmv@news.rain.org>
References: <4epq2e$h4b@crl2.crl.com>
NNTP-Posting-Host: @outback.eiffel.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 1.12 (X11; I; Linux 1.2.8 i586)
To: sorkin@crl.com
X-URL: news:4epq2e$h4b@crl2.crl.com