[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-gcc
Subject:    Re: Shared libraries
From:       lawson_whitney () juno ! com
Date:       2000-06-16 2:22:32
[Download RAW message or body]

What shared libraries are you having trouble with?
The troubles most people have with ld are usually because they don't
understand that unless directed otherwise it is a ONE PASS linker.
if you mention a library to it that defines a symbol, but you haven't
mentioned a library or object file that needs that symbol, it forgets
it, so if you then mention a library or object file that needs it, it is
undefined.  Either order your references to occur before your
definitions (in the ld command line (gcc will generate one from the gcc
command line)), or group libraries with the -( option.  Also known as
--start-group.  info ld is pretty good on this.  I am afraid I have a
hard time finding it in man ld, but I think I've seen it there too.
Oh, you may mention the same library more than once in the ld command
line.  Sometimes that is easier.

If you want something really simple that uses shared libraries, you
could look at

ftp://metalab.unc.edu/pub/Linux/utils/console/lockvc-3.6.tgz

or even simpler,

ftp://metalab.unc.edu/pub/Linux/utils/text/safe-1.3.8.tar.bz2

or

ftp://nwonknu.org/pub/junopine-1.5.6.tar.gz

Those are all from memory, but should be close enough to find.

If you want something hairy that uses shared libraries, look at

 
ftp://metalab.unc.edu/pub/Linux/ALPHA/wine/development/Wine-20000614.tar.gz
 
ftp://tsx-11.mit.edu/pub/linux/ALPHA/Wine/development/Wine-20000614.tar.gz
 
ftp://ftp.infomagic.com/pub/mirrors/linux/sunsite/ALPHA/wine/development/Wine-20000614.tar.gz
 
ftp://orcus.progsoc.uts.edu.au/pub/Wine/development/Wine-20000614.tar.gz


On Thu, 15 Jun 2000, Jeff Parker wrote:

> I'm new to creating  and using shared libraries in LINUX.  When I use
> static libraries while building an application, everything works fine
> but going to shared libaries , I get many 'undefined references' to
> calls in other libraries that my program never needs.  Is there a
switch
> for gcc that stops trying to resolve the dependencies when they aren't
> needed?
>
Oh, a switch.  You can tell ld, -noinhibit-exec.  On the gcc command
line, that would be spelled -Wl,-noinhibit-exec

> If any one has some example makefiles for shared libaries and/or
> applications using shared libraries, I'd appreciate a look.
>
> Thanks,
>
> Jeff Parker
>
>
Lawson

For the man who rises early is a man whose life is lost.
He will never know what he has missed till he's counted up the cost.
It's too late to put eggs in the nest when the bird's already flown.
If you're known as an early riser you can sleep till the cows com home.

                            - Robbie O'Connell
-------------------------




________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic