www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/13/11:22:11

To: Barnett C Hsu <hsub AT watmail DOT ucr DOT edu>
Cc: Bill Davidson <bdavidson AT ra DOT isisnet DOT com>,
Mark Hull-Richter <mhr AT sparc DOT sandiegoca DOT attgis DOT com>,
djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Problems with (first compile under) djgpp/gcc
Date: Thu, 09 Feb 95 07:55:13 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>

>> 
>> The order of arguments to gcc or ld should make no difference.
>> 
>
> Maybe it's just me, but it does seem to make a difference when
> compiling C++ code.  If I do "gcc -lgpp test.cc", I get a whole
> lot of linker errors all on C++ stuff.  But if I do 
> "gcc test.cc -lgpp", everything is happy and the errors go away.

The relative order of the libraries does matter, and also the
fact that you must put all the libraries AFTER all the objects,
but the relative order of the objects (usually) shouldn't matter.
In the original posting, the issue was about object files' order.
GNU ld (like most of Unix linkers I've seen) is a one-pass
linker, which makes it unhappy if you move a library before the
object file which calls functions in that library.

- Raw text -


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