This is the mail archive of the newlib@sourceware.cygnus.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How to use newlib



-----Original Message-----
From: Sascha Ziemann <szi@aibon.ping.de>
To: newlib@sourceware.cygnus.com <newlib@sourceware.cygnus.com>
Date: Thursday, April 27, 2000 11:19 AM
Subject: How to use newlib


>Hi,
>
>what is the right way to use newlib?  I tried to compile a simple
>hello world, but I get only errors:
>
>gcc -Wall -I../newlib-1.8.2.inst/i686-pc-linux-gnu/include   -c hello.c -o
hello.o
>gcc -L. -static  hello.o libnosys.a   -o hello
>/usr/lib/crt1.o: In function `_start':
>/usr/lib/crt1.o(.text+0xe): undefined reference to `__libc_init_first'
>/usr/lib/crt1.o(.text+0x18): undefined reference to `_environ'
>./libc.a(exit.o): In function `exit':
>/home/olivia/szi/software/smbproxy/1.1.1/bootdisk/newlib-1.8.2/newlib.build
/libc/stdlib/../../../newlib/libc/stdlib/exit.c:70: undefined reference to
`_exit'
>./libc.a(sbrkr.o): In function `_sbrk_r':
>/home/olivia/szi/software/smbproxy/1.1.1/bootdisk/newlib-1.8.2/newlib.build
/libc/reent/../../../newlib/libc/reent/sbrkr.c:61: undefined reference to
`sbrk'
>./libc.a(makebuf.o): In function `__smakebuf':
>/home/olivia/szi/software/smbproxy/1.1.1/bootdisk/newlib-1.8.2/newlib.build
/libc/stdio/../../../newlib/libc/stdio/makebuf.c:93: undefined reference to
`isatty'
>./libc.a(writer.o): In function `_write_r':
>/home/olivia/szi/software/smbproxy/1.1.1/bootdisk/newlib-1.8.2/newlib.build
/libc/reent/../../../newlib/libc/reent/writer.c:58: undefined reference to
`write'
>./libc.a(closer.o): In function `_close_r':
>/home/olivia/szi/software/smbproxy/1.1.1/bootdisk/newlib-1.8.2/newlib.build
/libc/reent/../../../newlib/libc/reent/closer.c:53: undefined reference to
`close'
>./libc.a(fstatr.o): In function `_fstat_r':
>/home/olivia/szi/software/smbproxy/1.1.1/bootdisk/newlib-1.8.2/newlib.build
/libc/reent/../../../newlib/libc/reent/fstatr.c:61: undefined reference to
`fstat'
>./libc.a(lseekr.o): In function `_lseek_r':
>/home/olivia/szi/software/smbproxy/1.1.1/bootdisk/newlib-1.8.2/newlib.build
/libc/reent/../../../newlib/libc/reent/lseekr.c:58: undefined reference to
`lseek'
>./libc.a(readr.o): In function `_read_r':
>/home/olivia/szi/software/smbproxy/1.1.1/bootdisk/newlib-1.8.2/newlib.build
/libc/reent/../../../newlib/libc/reent/readr.c:58: undefined reference to
`read'
>collect2: ld returned 1 exit status
>make: *** [hello] Error 1
>
>Sascha
>
The right way to use the newlibs are as folllows.

For libc: -lc
for libm: -lm

Note, that is small L, not one (1)

_____________________________________________
NetZero - Defenders of the Free World
Click here for FREE Internet Access and Email
http://www.netzero.net/download/index.html

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]