🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.programmer
4 messages
4 total messages Started by lhui Tue, 15 Aug 2000 00:46
How do I link together multiple dependent obj files?
#3598
Author: lhui
Date: Tue, 15 Aug 2000 00:46
22 lines
1465 bytes
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



Sent via Deja.com http://www.deja.com/
Before you buy.
Re: How do I link together multiple dependent obj files?
#3595
Author: 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)
Re: How do I link together multiple dependent obj files?
#3596
Author: Brian Horton
Date: Tue, 15 Aug 2000 00:00
29 lines
1609 bytes
Go to

http://www.gnu.org/manual/ld-2.9.1/html_mono/ld.html#SEC3

and look for 'start-group' and 'end-group' - it'll cause ld to keep
running thru the archives until it works out all dependencies.

.bri.

lhui@sfu.ca wrote:
> 
> 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
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Re: How do I link together multiple dependent obj files?
#3597
Author: rob
Date: Tue, 15 Aug 2000 00:00
26 lines
1378 bytes
After listing all your libraries in the link line, list them a second time.
Tacky, isn't it?

<lhui@sfu.ca> wrote in message news:8na3sb$s78$1@nnrp1.deja.com...
> 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
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads