undefined references?

Nick Papadonis npapadon@yahoo.com
Mon May 7 06:49:00 GMT 2001

I'm trying to compile some test code with newlib.  I did a unified
build of newlib,gcc,gas, and ld. Apparently my linker isn't finding
symbols in my newlib libraries.  Anyone have any idea whats happening
here?  Thanks.

- Nick

#include <math.h>
#include <string.h>

static void _main (void) {
  double d;

  d  = cosh(20.0);


[nick@noop lib]$ m68k-coff-nm libm.a |grep cosh
         U __ieee754_cosh
00000006 T cosh

[nick@noop test2]$ make 
m68k-coff-ld --verbose -lm -lc -T./ram.ld crt0.o test.o -o main
GNU ld version 2.11.90 (with BFD 2.11.90)
  Supported emulations:
opened script file ./ram.ld
attempt to open /usr/local/m68k-coff/m68k-coff/lib/libm.a succeeded
attempt to open /usr/local/m68k-coff/m68k-coff/lib/libc.a succeeded
attempt to open crt0.o succeeded
attempt to open test.o succeeded
test.o: In function `_main':
/home/nick/build/test2/test.c:17: undefined reference to `cosh'
make: *** [main] Error 1

More information about the Newlib mailing list