delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2006/01/16/00:05:00

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Mon, 16 Jan 2006 00:04:31 -0500
Message-Id: <200601160504.k0G54VIT002341@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <1137386825.476664.256630@g49g2000cwa.googlegroups.com>
(liuseu AT gmail DOT com)
Subject: Re: how to correct link error
References: <1137386825 DOT 476664 DOT 256630 AT g49g2000cwa DOT googlegroups DOT com>
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

If you have two libraries which depend on each other, you really have
one library and should build them as one library.  Or build them as
objects, not libraries.  In general, two-way dependencies indicate
that you haven't organized your libraries very well.

However, recent linkers have options -( and -) to "group" libraries
for such cases.  You can also create a "group" library which has a
library filename (bc.a) but has as its contents a link script (text
file) which defines a grouped list of libraries.

gcc a.c -( -lb -lc -) -o a.exe

Might need quotes around those, depending on which shell you use.

- Raw text -


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