Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-Id: <4.3.1.2.20010101185321.0214dbd8@pop.ma.ultranet.com> X-Sender: lhall AT pop DOT ma DOT ultranet DOT com X-Mailer: QUALCOMM Windows Eudora Version 4.3.1 Date: Mon, 01 Jan 2001 18:55:40 -0500 To: "Billinghurst, David (CRTS)" , "'cygwin AT sources DOT redhat DOT com'" From: "Larry Hall (RFK Partners, Inc)" Subject: Re: g77 -lm doesn't work In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 08:19 AM 1/1/2001, Billinghurst, David (CRTS) wrote: >Using cygwin 1.17-1, if I try to link any Fortran program with -lm I get the >error > >/usr/lib/gcc-lib/i686-pc-cygwin/2.95.2-6/../../../../i686-pc-cygwin/lib/libm >.a(libcmain.o)(.text+0x7f): undefined reference to `WinMain AT 16' >collect2: ld returned 1 exit status > >Now libm.a is a symbolic link to libcygwin.a. I believe the root cause is >linking libcygwin.a before libg2c.a since for any Fortran program I see > >g77 foo.f OK >g77 foo.f -lm FAIL >g77 foo.f -lg2c -lm OK >g77 foo.f -lcygwin FAIL >g77 foo.f -lg2c -lcygwin OK > >Now the obvious solution is to not use -lm, but then I have to edit >Makefiles (or even worse - hack Dejagnu so I can run the g77 testsuite). >Once upon a time the cygwin libm.a was an empty archive. Can we revert to >this? > >+++++++++++++++++++++++++++++++++++++++++ >(Mr) David Billinghurst >Comalco Research Centre >PO Box 316, Thomastown, Vic, Australia, 3074 >Phone: +61 3 9469 0642 >FAX: +61 3 9462 2700 >Email: David DOT Billinghurst AT riotinto DOT com DOT au No, reverting isn't an option. Some packages look for certain functionality in libm.a as part of their configure (if I remember correctly - and if not, you'll find the precise answer in the mail archives!;-)) Perhaps this issue could be resolved in the specs file (forgive me, I'm pretty ignorant of gcc internals)? Larry Hall lhall AT rfk DOT com RFK Partners, Inc. http://www.rfk.com 118 Washington Street (508) 893-9779 - RFK Office Holliston, MA 01746 (508) 893-9889 - FAX -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple