This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


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

Re: stdlib question?


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"


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