This is the mail archive of the
mailing list for the Cygwin project.
g77 -lm doesn't work
- To: "'cygwin at sources dot redhat dot com'" <cygwin at sources dot redhat dot com>
- Subject: g77 -lm doesn't work
- From: "Billinghurst, David (CRTS)" <David dot Billinghurst at riotinto dot com>
- Date: Mon, 1 Jan 2001 13:19:56 -0000
Using cygwin 1.17-1, if I try to link any Fortran program with -lm I get the
.a(libcmain.o)(.text+0x7f): undefined reference to `WinMain@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
(Mr) David Billinghurst
Comalco Research Centre
PO Box 316, Thomastown, Vic, Australia, 3074
Phone: +61 3 9469 0642
FAX: +61 3 9462 2700
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple