🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #6094

trouble compiling

#6094
From: root
Date: Tue, 26 Nov 1996 00:00
31 lines
1804 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));
}

Simple, to the point, and, from what I can tell, syntactically correct.  
I'm not sure what this message is trying to tell me, but it sounds to me 
like it can't find the header file... but I really have no idea.  I'd 
include the complete -v output of the compile if I could, but I don't 
know how to redirect standard error, and I really don't feel like copying 
down the whole page of messages.  Also, I got a similar message 
("undefined reference to <whatever>") when trying to use some of my own 
functions defined in separate files.  I'm somewhat new to C, so I could 
be missing something very obvious to someone else...but I'd appreciate 
any help I can get!  So... if anyone gets this message, a reply would be 
greatly appreciated (did I repeat myself there?).  Thanks in advance.

Brian Cochrane
brideb@efn.org
Technical Details
Message-ID: <Pine.LNX.3.91.961126225116.686A-100000@lazarus.blasphuphmus.com>
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,start
X-Google-Attributes: gid113d02,public
From: root@lazarus.blasphuphmus.com (root)
Subject: trouble compiling
Date: 1996/11/26
Message-ID: <Pine.LNX.3.91.961126225116.686A-100000@lazarus.blasphuphmus.com>
X-Deja-AN: 200982261
sender: bug-gcc-request@prep.ai.mit.edu
x-gateway: relay2.UU.NET from bug-gcc to gnu.gcc.bug; Wed, 27 Nov 1996 01:58:08 EST
content-type: TEXT/PLAIN; charset=US-ASCII
mime-version: 1.0
newsgroups: gnu.gcc.bug