X-Authentication-Warning: acp3bf.physik.rwth-aachen.de: broeker owned process doing -bs Date: Sun, 25 Mar 2001 20:53:52 +0200 (MET DST) From: Hans-Bernhard Broeker X-Sender: broeker AT acp3bf To: DJGPP list Subject: Re: help - collect2.exe not linking element from a library In-Reply-To: <7263-Sun25Mar2001202922+0200-eliz@is.elta.co.il> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie 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 Precedence: bulk On Sun, 25 Mar 2001, Eli Zaretskii wrote: > > From: Hans-Bernhard Broeker > > Newsgroups: comp.os.msdos.djgpp > > Date: 25 Mar 2001 16:12:19 GMT > > > > Eli Zaretskii wrote: > > [...] > > > You forgot that ld.exe is a one-pass linker: it only scans the > > > libraries once, in the order you specify them in the link command > > > line. > > > > Hmmm... but isn't this true only for those libraries you specify with > > -l arguments? Libs given by actual filename (like the OP's > > c:/.../libmwin.a) are treated like .o files, and those are not subject > > to one-pass-only treatment, AFAIK. > > Are you saying that if I use libc.a instead of -lc, the linker pulls > the _entire_ library into the executable? That would be the only way > it could work around its one-pass nature. I doubt that the linker > does that, though. Turns out Eli's right, as usual. -lname is exactly equivalent to passing the full name /some/directory/name/libname.a, including the fact that it'll only be parsed once, at the place it occurs. So, to overcome the OP's problem, the --( --) approach or repeated listing of the same library is, indeed, necessary. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.