delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/30/21:55:42

Message-Id: <199810010155.VAA28401@delorie.com>
Comments: Authenticated sender is <mert0407 AT sable DOT ox DOT ac DOT uk>
From: "George Foot" <george DOT foot AT merton DOT ox DOT ac DOT uk>
To: Yu Jaemin <asiawide AT soback DOT kornet DOT nm DOT kr>
Date: Thu, 1 Oct 1998 02:53:16 +0000
MIME-Version: 1.0
Subject: Re: Need for Math library
Reply-to: mert0407 AT sable DOT ox DOT ac DOT uk
CC: djgpp AT delorie DOT com
X-mailer: Pegasus Mail for Win32 (v2.42a)

On 30 Sep 98 at 23:58, Yu Jaemin wrote:

> Martin Ambuhl <mambuhl AT earthlink DOT net> wrote:
> > Yu Jaemin wrote:
> >> 
> >> FYI, 'gcc -lm test.c'
> >>           ~~~
> >> 
> >> can link math library to your program.
> 
> > FYI, the correct order is 'gcc test.c -lm'
> 
> > -- 
> > Martin Ambuhl (mambuhl AT earthlink DOT net)
> > Note: mambuhl AT tiac DOT net will soon be inactive
> 
> well....I'm sorry for that. 
> but gcc -lm xxx.c is also working, isn't it?

The linker processes libraries from left to right.  It only 
links in parts of libraries that have been used by things 
appearing to the left of the library on the command line.

I think your command would not have linked any of the library 
-- your C file would have been using libc's versions of the 
maths functions.

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

- Raw text -


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