delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/04/05/15:55:14

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: <4.3.1.2.20010405154008.021ea950@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: Thu, 05 Apr 2001 15:43:18 -0400
To: "Latyr Jean-Luc FAYE" <webmaster AT faye DOT cjb DOT net>,
"Cygwin" <cygwin AT cygwin DOT com>
From: "Larry Hall (RFK Partners, Inc)" <lhall AT rfk DOT com>
Subject: Re: Rep: Re: Compiling with Borland C but not with Cygwin !!!
In-Reply-To: <02cb01c0be05$38cac2a0$99face88@dcu.ie>
References: <NFBBJAJICAKJPMMKDAGBEENPCBAA DOT wpd AT delcomsys DOT com>
Mime-Version: 1.0

At 03:18 PM 4/5/2001, Latyr Jean-Luc FAYE wrote:
> > 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



You want to check out the documentation for gcc (via info, man, or look on
the web) to understand the flag ordering.  

Cygwin has one library to implement everything.  Therefore, you don't need
-lm, although libm.a should be linked to libcygwin.a to make this work if 
your flag ordering is right.



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

- Raw text -


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