This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: problems linking
- To: Norman Frederick <normanf at qualcomm dot com>
- Subject: Re: problems linking
- From: Don Sharp <dwsharp at iee dot org>
- Date: Sat, 08 Sep 2001 08:18:55 +0100
- CC: gnuwin32 <cygwin at cygwin dot com>
- References: <4.3.2.7.2.20010907161012.00bada60@adept.qualcomm.com>
Norman Frederick wrote:
>
> Dear Sirs:
>
> I am having problems linking modules compiled using your gcc.
>
> example:
>
> gcc -c simple.c
>
try just
gcc simple.c
gcc constructs the necessary list of extra files that MUST be included
in the link.
> ld simple.o crt0.o -lm -lc
> get error:
> /usr/lib/libm.a<_cygwin_crt0_common.o>undefined reference to GETModuleHandleA@4
>
> What is missing?
>
IMHO one should NEVER use ld directly unless you know PRECISELY what you
are doing. I hate to think of the number of times that I have run foul
of this problem because of different underlying system behaviour.
> I have also tried
>
> ld simple.o -lm -lc crt0.o gcrt
> but get a bunch of undefined references.
>
> Thanks,
> Norman
>
Cheers
Don Sharp
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/