🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #49487

re:re:re Problems with libraries 2.4.5

#49487
From: Chris Metzl
Date: Tue, 25 Jan 1994 20:16
56 lines
2853 bytes
Okay, I tried the gcc -v -O -o <file><file.c> and get this output with
this little test program, PLEASE HELP!!!!(pout)

----------------PROGRAM---------------

/*User "gli" is a c programmer.  He tried the following simple test program
that is designed to calculate x raised to the power y. */

  #include </usr1/local/lib/gcc-lib/sun4/2.4.5/include/math.h>

  main()
  {
    double x = 10.0, y = 0.0;

    do {
        printf("%f", pow(x,y));
        y++;
    } while(y < 11);
  }

/* This is what he types on the command line where "power.c" is the named of
the source code file:

  gcc power.c -o power

This is the error message:

  ld: Undefined symbol
       _pow
  collect:  ld returned 2 exit status

It looks like it can't find the math library.  Do you know what the
problem might be?  I haven't done any looking around.  Thought I'd ask you
first.  Thanks.

David Renneke */

--------------------GCC -v -O -o <file> <file.c> OUTPUT------------

gcc version 2.4.5
 /usr1/local/lib/gcc-lib/sun4/2.4.5/cpp -lang-c -v -undef -D__GNUC__=2 -Dsparc -Dsun -Dunix -D__GCC_NEW_VARARGS__ -D__sparc__ -D__sun__ -D__unix__ -D__GCC_NEW_VARARGS__ -D__sparc -D__sun -D__unix -D__GCC_NEW_VARARGS__ -D__OPTIMIZE__ math1b.c /usr/tmp/cca01672.i
GNU CPP version 2.4.5 (sparc)
 /usr1/local/lib/gcc-lib/sun4/2.4.5/cc1 /usr/tmp/cca01672.i -quiet -dumpbase math1b.c -O -version -o /usr/tmp/cca01672.s
GNU C version 2.4.5 (sparc) compiled by GNU C version 2.4.5.
 as -o /usr/tmp/cca016721.o /usr/tmp/cca01672.s
 /usr1/local/lib/gcc-lib/sun4/2.4.5/ld -e start -dc -dp -o math /lib/crt0.o -L/usr1/local/lib/gcc-lib/sun4/2.4.5 -L/usr1/local/lib /usr/tmp/cca016721.o -lgcc -lc -lgcc
ld: Undefined symbol 
   _pow 
collect: ld returned 2 exit status
-----------------------------------
Any help would be seriously appreciated...
-- 
===----------------------------(***)-----------------------===
Malfador the Mostly Mighty   |   malfador@helios.augustana.edu
    Malfador@JediMUD <===--------- stimpy.psy.jhu.edu 4000
And always remember....NO MATTER WHERE YOU GO...THERE YOU ARE.
Technical Details
Message-ID: <malfador.759528899@bradley.bradley.edu>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!scsing.switch.ch!swidir.switch.ch!univ-lyon1.fr!ghost.dsi.unimi.it!batcomputer!caen!sol.ctr.columbia.edu!howland.reston.ans.net!vixen.cso.uiuc.edu!bradley.bradley.edu!bradley.bradley.edu!malfador

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,3a25b8cf8f2856be,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1994-01-26 00:09:18 PST
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!scsing.switch.ch!swidir.switch.ch!univ-lyon1.fr!ghost.dsi.unimi.it!batcomputer!caen!sol.ctr.columbia.edu!howland.reston.ans.net!vixen.cso.uiuc.edu!bradley.bradley.edu!bradley.bradley.edu!malfador
From: malfador@helios.augustana.edu (Chris Metzl)
Newsgroups: gnu.gcc.help
Subject: re:re:re Problems with libraries 2.4.5
Date: 25 Jan 1994 14:16:44 -0600
Organization: Augustana College
Lines: 56
Message-ID: <malfador.759528899@bradley.bradley.edu>
NNTP-Posting-Host: helios.augustana.edu
X-Newsreader: NN version 6.5.0 #2 (NOV)