This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Simple question about GCC segments
- To: help-gcc at gnu dot org
- Subject: Re: Simple question about GCC segments
- From: Anthony Green <green at fencer dot cygnus dot com>
- Date: 01 Oct 1999 05:19:35 -0700
- Newsgroups: gnu.gcc.help
- Organization: Cygnus Solutions
- References: <37E8C861.B7681899@qem.it> <37F3AC7F.1678E279@spawar.navy.mil>
- Xref: wodc7nx0 gnu.gcc.help:1232
Lam Lee <lamlee@spawar.navy.mil> writes:
> 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.
> ld -o bt5mon.out start.o hwinit.o bt5mon.o -lg -Tbt5mon.lnk
> c:/cygnus/bin/../lib/libg.a(strtol.o)(.text+0x10a):strtol.c: undefined
> reference
> to `__umodsi3'
Yes. The missing code is in libgcc.a. Link with gcc instead of ld.
Gcc will make sure libgcc.a is always linked in (try `gcc -v' to see
what it is doing).
Good luck,
AG
--
Anthony Green Cygnus Solutions
Sunnyvale, California