🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #42486

Re: unresolved symbols

#42486
From: Rusty, Paul , Russell
Date: Wed, 06 Dec 1995 00:00
19 lines
1289 bytes
In message <rbuchmanDJ5I3w.463@netcom.com> you write:
> I am using DEC Unix OSF/1 3.2b and gcc 2.7.2 to program a simple  math
> problem.  i include <math.h> in the program but when i compile it i
> get an error when it tries to link the binary.  the problme is that it
> cannot resolve sin, cos, pow, sqrt.  am i missing something?? the

Hi Richard,
	Try adding "-lm" to your link line.  This tells it to link with
the maths library, which is not linked in by default under Unix.

	eg. to compile up "problem.c" which uses a function in <math.h>,

	foobar 100% gcc -o problem problem.c -lm

Hope that helps,
Rusty.
--
Rusty.Russell@adelaide.maptek.com.au           "Engineer? So you drive trains?"
Lies, damned lies, and out-of-date documentation.        #include <stddisclm.h>
Technical Details
Message-ID: <199512060918.TAA18662@gauss.adelaide.maptek.com.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <rbuchmanDJ5I3w.463@netcom.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,b66ab31328ff09,start
X-Google-Attributes: gid11318c,public
From: Rusty.Russell@adelaide.maptek.com.au (Rusty, Paul ,  Russell)
Subject: Re: unresolved symbols
Date: 1995/12/06
Message-ID: <199512060918.TAA18662@gauss.adelaide.maptek.com.au>
X-Deja-AN: 121063389
distribution: gnu
sender: daemon@cis.ohio-state.edu
references: <rbuchmanDJ5I3w.463@netcom.com>
organization: GNUs Not Usenet
newsgroups: gnu.gcc.help