This is the mail archive of the
mailing list for the Cygwin project.
RE: Re: Compiling with Borland C but not with Cygwin !!!
- To: Cygwin <cygwin at cygwin dot com>
- Subject: RE: Re: Compiling with Borland C but not with Cygwin !!!
- From: "Schaible, Joerg" <Joerg dot Schaible at gft dot com>
- Date: Fri, 6 Apr 2001 12:57:48 +0200
May be you missed, that in Unix environments the sequence of the linked
objects and libraries is meaningful while Windows linkers normally do not
care. With Cygwin libm.a is a reference to libcygwin.a that has its own main
function. Since the linker "sees" this function first coming from the
library and one provided by your code (with higher precedence, since it is
not from a lib), the Unix linker fails.
>From: Latyr Jean-Luc FAYE [mailto:Latyr.Faye2@mail.dcu.ie]
>Sent: Thursday, April 05, 2001 9:19 PM
>Subject: Rep: Re: Compiling with Borland C but not with Cygwin !!!
>> Don't place -lm at the beginning of the command line. Place
>it at the
>Thanks folks it works.
>A few more questions on this behaviour.
>I'm a Cygwin's newbie (3 days now) and I would like to know
>what was wrong.
>I mean why
>gcc -otest.exe file.c is OK
>gcc -otest.exe file.c -lm is OK
>gcc -lm -otest.exe file.c -lm is NOT OK
>I am more surprised by the fact that
>gcc -otest.exe file.c is OK because I am using math.h in
>file.c and I learnt
>at school that when I use math.h I should put -lm in the
>Latyr Jean-Luc FAYE
>Want to unsubscribe from this list?
>Check out: http://cygwin.com/ml/#unsubscribe-simple
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple