delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/04/06/06:59:43

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <C2D7D58DBFE9D111B0480060086E96350368B768@mail.gft.de>
From: "Schaible, Joerg" <Joerg DOT Schaible AT gft DOT com>
To: Cygwin <cygwin AT cygwin DOT com>
Subject: RE: Re: Compiling with Borland C but not with Cygwin !!!
Date: Fri, 6 Apr 2001 12:57:48 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)

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.

>-----Original Message-----
>From: Latyr Jean-Luc FAYE [mailto:Latyr DOT Faye2 AT mail DOT dcu DOT ie]
>Sent: Thursday, April 05, 2001 9:19 PM
>To: Cygwin
>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
>end.
>>
>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 
>compilation line
>
>Regards
>
>Jean-Luc
>
>---
>Latyr Jean-Luc FAYE
>http://faye.cjb.net
>
>
>
>--
>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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019