ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/06/12/04:58:09

Date: Fri, 12 Jun 92 10:09:39 GMT
From: kuku AT acds DOT physik DOT rwth-aachen DOT de (Christoph Kukulies)
To: apollo AT ee DOT ualberta DOT ca, djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Math functions not included?

Apollo,
please try

gcc math.c -lm -lc

In the example you gave the arguments are passed to ld in the same order
you gave it to gcc thus having ld to search libm.a first with nothing to resolve.
When it then comes to your module the search through libm.a is already done.
You have to put -lm after all your object modules. You may also omit -lc
because libc.a is searched by default but the order *is* important.

--Chrius

- Raw text -


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