🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #51707

Using the ANSI standard library include files

#51707
From: Kevin Bassler
Date: Thu, 15 Apr 1993 11:32
49 lines
1599 bytes
Hello,

I have recently installed gcc version 2.3.3 on my sun sparcstation ELC 
running sunos-4.1.3.
I used default file configuration when I installed gcc. For example the 
ANSI standard include files appear to be in /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/include.

My problem is that when I compile a c program that uses functions from the
ANSI standard library it seems that the library is not found. Do I need to 
set some compiler option so that gcc looks for those libraries?

 

My problem shows up in the following example:

Consider the program test.c:
 
#include <stdio.h>
#include <math.h>

main()
{
    int i,j;
    double x;

    x = exp(0.5);

    printf("\nx = %f ", x);

}


when I compile test.c by


gcc test.c


I get the error message:

ld: Undefined symbol
   _exp
collect: /usr/bin/ld returned 2 exit status


Thanks for your help,

Kevin Bassler
Bassler@AURA.PHYS.VT.EDU
Technical Details
Message-ID: <9304151927.AA10725@life.ai.mit.edu>
Path: arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!mcsun!uunet!ogicse!uwm.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!aura.phys.vt.edu!bassler

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,509c27ba02e835e4,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-04-15 12:58:15 PST
Path: arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!mcsun!uunet!ogicse!uwm.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!aura.phys.vt.edu!bassler
From: bassler@aura.phys.vt.edu (Kevin Bassler)
Newsgroups: gnu.gcc.help
Subject: Using the ANSI standard library include files
Message-ID: <9304151927.AA10725@life.ai.mit.edu>
Date: 15 Apr 93 11:32:14 GMT
Article-I.D.: life.9304151927.AA10725
Sender: daemon@cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 49