🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3595

Re: How do I link together multiple dependent obj files?

#3595
From: Steve Preston
Date: Tue, 15 Aug 2000 00:00
40 lines
1763 bytes
lhui@sfu.ca writes:

> Help!!
> 
> I am having trouble linking multiple files that depend on each other
> (possibly have circular dependencies too)?  What is the correct way to
> link this?
> 
> I have tried shuffling the object files around but to no avail.  It
> fixes some of the undefined symbols, but other symbols become undefined.
> 
> Is this where incremental linking is supposed to come into play?  How
> do I do incremental linking...
> 
> 
> help help help
> 
> 
> thanks for the help in advance

You didn't mention which platform you are on.  Different UNIXes have
different linkers.

I presume you don't really mean "object files" (whose names usually
end in .o on UNIX machines), but "object libraries" (whose names are
of the form lib<name>.a, or .so, or .sl, etc.).  I presume this
because all linkers that I know of link object files in their
entirety, if they get linked at all.

Anyway, it is alright, and in your case it sounds essential, to
mention the same library multiple times on a command line.  If libone
and libtwo have some circular dependencies, it may be necessary to have

    -lone -ltwo -lone

on the command to successfully link.


-- 
Steve Preston (spreston@gte.com)
Technical Details
Message-ID: <ue1yzqik8u.fsf@eowyn.gte.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8na3sb$s78$1@nnrp1.deja.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,48e90ecbd31f1e02
X-Google-Attributes: gid11318c,public
X-Google-Thread: fc89c,48e90ecbd31f1e02
X-Google-Attributes: gidfc89c,public
From: Steve Preston <steve@eowyn.gte.com>
Subject: Re: How do I link together multiple dependent obj files?
Date: 2000/08/15
Message-ID: <ue1yzqik8u.fsf@eowyn.gte.com>
X-Deja-AN: 658566881
References: <8na3sb$s78$1@nnrp1.deja.com>
Organization: GTE Laboratories
Newsgroups: comp.unix.programmer,gnu.gcc.help