Unix Programming - .so equal to .dll

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > August 2006 > .so equal to .dll





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author .so equal to .dll
puzzlecracker

2006-08-08, 1:24 am

if .so is equal .dll library then what does .lib equals to? does unix
has an equivalent?

thanks

yanamandra

2006-08-08, 1:24 am


puzzlecracker wrote:
> if .so is equal .dll library then what does .lib equals to? does unix
> has an equivalent?
>
> thanks


..lib's equivalent if I am not wrong is .a (archive). I am not sure
about .lib of windows as I worked not even 10% of my time on windows.
But, yes., if it is a statically linked library, then, yes., .a of unix
works the same way.

u can ask your linker to find all the required references in the .as'
which is an archive of the .o files of your c program.

Michel Bardiaux

2006-08-08, 7:28 am

yanamandra wrote:
> puzzlecracker wrote:
>
> .lib's equivalent if I am not wrong is .a (archive). I am not sure
> about .lib of windows as I worked not even 10% of my time on windows.
> But, yes., if it is a statically linked library, then, yes., .a of unix
> works the same way.


The other use of .lib in Windows is as an *export* library for a .dll.
Unix has no equivalent because the link-edition is performed directly
against the .so.

>
> u can ask your linker to find all the required references in the .as'
> which is an archive of the .o files of your c program.
>



--
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux@mediaxim.be

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/
Ralf Fassel

2006-08-08, 7:28 am

* "puzzlecracker" <ironsel2000@gmail.com>
| if .so is equal .dll library then what does .lib equals to? does
| unix has an equivalent?

With Windows shared libraries you need the .lib to tell what is in
the .dll. On Unix, you can link directly against the .so, you don't
need a separate index here.

When talking about static libraries, Unix .a is the equivalent of
Windows .lib.

HTH
R'
puzzlecracker

2006-08-08, 1:27 pm


Ralf Fassel wrote:
> * "puzzlecracker" <ironsel2000@gmail.com>
> | if .so is equal .dll library then what does .lib equals to? does
> | unix has an equivalent?
>
> With Windows shared libraries you need the .lib to tell what is in
> the .dll. On Unix, you can link directly against the .so, you don't
> need a separate index here.
>
> When talking about static libraries, Unix .a is the equivalent of
> Windows .lib.
>
> HTH
> R'

THere is no dynamically linked libraries in unix? meaning that .so is
simalar to .obj?

Ralf Fassel

2006-08-08, 1:27 pm

* "puzzlecracker" <ironsel2000@gmail.com>
| THere is no dynamically linked libraries in unix?

Misunderstanding. Of course there are shared libraries on Unix.

| meaning that .so is simalar to .obj?

The .so (or .sl on HP-UX) is the shared library on Unix. You use the
same .so for linking and at runtime. In contrast to Windows there is
just no export-.lib for shared linking on Unix. It is all done by a
single file, the .so.

R'
puzzlecracker

2006-08-08, 7:21 pm


Ralf Fassel wrote:
> * "puzzlecracker" <ironsel2000@gmail.com>
> | THere is no dynamically linked libraries in unix?
>
> Misunderstanding. Of course there are shared libraries on Unix.
>
> | meaning that .so is simalar to .obj?
>
> The .so (or .sl on HP-UX) is the shared library on Unix. You use the
> same .so for linking and at runtime. In contrast to Windows there is
> just no export-.lib for shared linking on Unix. It is all done by a
> single file, the .so.
>
> R'


Binaries, in win32, use .lib files to resolve dependencies and have
definitions of what is in .dll. How does UNIX resolve that? Can someone
illustrate with an example.


thx

Brian Raiter

2006-08-08, 7:21 pm

> Binaries, in win32, use .lib files to resolve dependencies and have
> definitions of what is in .dll.


Yes. But Unix does not need to do this. In short:

The Unix .so file serves the purpose of BOTH the Windows .dll file
AND the Windows .lib file.

Is this clear?

b
phil-news-nospam@ipal.net

2006-08-12, 1:29 pm

On 8 Aug 2006 13:50:24 -0700 puzzlecracker <ironsel2000@gmail.com> wrote:
|
| Ralf Fassel wrote:
|> * "puzzlecracker" <ironsel2000@gmail.com>
|> | THere is no dynamically linked libraries in unix?
|>
|> Misunderstanding. Of course there are shared libraries on Unix.
|>
|> | meaning that .so is simalar to .obj?
|>
|> The .so (or .sl on HP-UX) is the shared library on Unix. You use the
|> same .so for linking and at runtime. In contrast to Windows there is
|> just no export-.lib for shared linking on Unix. It is all done by a
|> single file, the .so.
|>
|> R'
|
| Binaries, in win32, use .lib files to resolve dependencies and have
| definitions of what is in .dll. How does UNIX resolve that? Can someone
| illustrate with an example.

Think of the .so in Unix as being a combination of .dll and .lib in win32.
All the information that is needed to resolve symbols at run time, as well
as search symbols to match libraries at program linkage time, is in the .so
file.

You might wonder why this is. It might seem to you that it is a waste of
space to have more than is actually needed to resolve symbols when programs
are run. The answer to this is in the way these systems tend to be used.
Most Windows based computers are never used to compile programs, whether
those programs are written by the user of that computer, or obtained from
elsewhere. The latter tends to be especially rare because what program
sharing does exist within the Windows community tends to be binary only,
which is practical given that Windows has in the past, at least for the
average end user, run on only one platform. Unix, however, has for most
of its existance run on multiple platforms, making binary program sharing
less practical. So programs tend to be shared in source code and compiled
on each platform. With a few exceptions, Unix systems come with sufficient
tools to compile and link source programs. And this is done far more often
in Unix than in Windows. And even where the exceptions exist, free tools
to do so are generally available in a "binary to get started" form. There
was much incentive in Windows to have a split library format, but very
little in Unix. With the very large disk space of these days, there is
no impact of this decision.

If you come from the Windows community to the Unix community, one thing
you may need to get accustomed to is that many programs, especially the
free ones, come only in the form of source that you have to compile.

--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
| first name lower case at ipal.net / spamtrap-2006-08-12-1114@ipal.net |
|------------------------------------/-------------------------------------|
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com