This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: stdlib question?
- To: help-gcc at gnu dot org
- Subject: Re: stdlib question?
- From: Arthur Gold <agold at bga dot com>
- Date: Fri, 01 Oct 1999 18:52:52 -0500
- Newsgroups: gnu.gcc.help
- References: <37E8C861.B7681899@qem.it> <37F3ACBD.8874F01E@spawar.navy.mil>
- Xref: wodc7nx0 gnu.gcc.help:1246
Lam Lee wrote:
>
> Hello,
>
> Does anyone know why I get the undefined references below during link
> time? I cannot use majority of the functions in stdlib, but the functions
> in string.h seem compiling okay.
>
> Thanks!
> Lam
>
> as start.s -o start.o -L -a >start.l
> gcc -c -g -ms hwinit.c
> gcc -c -g -ms bt5mon.c
>
> ld -o bt5mon.out start.o hwinit.o bt5mon.o -lg -Tbt5mon.lnk
You probably need to add "-lc" to the link line (to link to the C
library)
> c:/cygnus/bin/../lib/libg.a(strtol.o)(.text+0x10a):strtol.c: undefined
> reference
> to `__umodsi3'
> c:/cygnus/bin/../lib/libg.a(strtol.o)(.text+0x11a):strtol.c: undefined
> reference
> to `__udivsi3'
> c:/cygnus/bin/../lib/libg.a(strtol.o)(.text+0x188):strtol.c: undefined
> reference
> to `__mulsi3'
>
> I
HTH.
--ag
--
Artie Gold, Austin, TX
mailto:agold@bga.com or mailto:agold@cs.utexas.edu
--
Pet peeve: "its" = belonging or pertaining to "it" | "it's" = "it is"