Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Does linux have libraries/dlls?

1 view
Skip to first unread message

Stephen Kay

unread,
Apr 12, 2004, 12:25:46 PM4/12/04
to
I'm looking at doing some linux development in C/C++, coming from a
background of Mac and some Windows.

I would assume Linux has the equivalent to static libraries (on Mac OS 9)
and DLLs on Windows?

Thanks -
Stephen

mjt

unread,
Apr 12, 2004, 5:49:40 PM4/12/04
to
Stephen Kay wrote:

... Linux/Unix has offers the ability to both
statically or dynamically link library routines
.
--
<< http://michaeljtobler.homelinux.com/ >>
Real computer scientists don't comment their code. The
identifiers are so long they can't afford the disk space.

Aravindh K

unread,
Apr 12, 2004, 6:45:26 PM4/12/04
to
You are right in assuming that.

Aravindh

Stephen Kay <s...@karma-lab.com> wrote in message news:<BCA03B2A.27F90%s...@karma-lab.com>...

Daniel LaBell

unread,
Apr 12, 2004, 7:17:58 PM4/12/04
to
Stephen Kay <s...@karma-lab.com> writes:

Linux has .so files Pronounced: dot S-O
.a files Pronounced: dot a
.o files Pronounced: dot o
(and a few other types )

.so files: These are shared objects, not only are they dynamically resolved,
but if more than 1 process/program/application uses the same lib,
the kernel will set up memory mapping to share the same memory space of the
lib. You may need to read up on paging and virtual memory to get this. And
paging opposed to just swapping. We call it a swapfile, but its paging,
probably just to keep it simpler for computer operators back in late 1970's
when UNIX got paging, as in why change mkswap to mkpage? etc.

Anyway, you can list the .so's used by a program
with the command ldd. Try ldd /bin/bash.
.SO's are generally supperior to to dll's.

.a files: These are lib files, contain .o files.
.o files: These are either kernel modules, or the product of .C .CC .c++
etc.

I think the equivalent you want to is the .a files. If you using Make
lookup ar, and ranlib.

Producing .SO files is some work, and generally,
I'd say unless your project, is in fact a general purpose lib, you don't
need to produce them, but should ensure, that you don't muck up the
linking so much that you use all static. I'd say the typical, smallish
project will static link its on .o's and .a's and link in libc, etc.
dynamically and (typically) this will be default compiler behavior.

Lewin A.R.W. Edwards

unread,
Apr 12, 2004, 8:21:56 PM4/12/04
to
> I would assume Linux has the equivalent to static libraries (on Mac OS 9)
> and DLLs on Windows?

Static and dynamic libraries are antonyms! In Linux, dynamic libraries
are called "shared objects" and have the prefix or "midfix" .so, e.g.
libc.so.6 - statically linked libraries are usually called something.a

Are you seeking to develop a dynamically linked library? Or are you
merely curious about underlying operating system mechanisms?

0 new messages