🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #6100

Re: trouble compiling

#6100
From: Philip Goisman
Date: Wed, 27 Nov 1996 00:00
21 lines
1017 bytes
>Hello... I recently started using the GCC C compiler on my Linux box, and 
>am having some trouble.  I'm trying to use the atan (arc tangent) 
>function (in math.h), but when I compile my code, the linker (I think) 
>tells me:
>/tmp/cca006221.o(.text+0x20): undefined reference to `atan'

>my (test) source code consists of the following:

>#include <stdio.h>
>#include <math.h>

>void main()
>{
> printf("%f\n",atan(5));
>}

	I compiled with gcc -Wall testP.c -lm
and got 1.373401.  You probably forget the -lm.

		Philip
Technical Details
Message-ID: <9611271545.AA18935@electron.physics.arizona.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,e1ba4014e84f7c11
X-Google-Attributes: gid113d02,public
From: goisman@electron.physics.arizona.edu (Philip Goisman)
Subject: Re:  trouble compiling
Date: 1996/11/27
Message-ID: <9611271545.AA18935@electron.physics.arizona.edu>
X-Deja-AN: 201051632
sender: bug-gcc-request@prep.ai.mit.edu
x-gateway: relay4.UU.NET from bug-gcc to gnu.gcc.bug; Wed, 27 Nov 1996 10:47:37 EST
newsgroups: gnu.gcc.bug