| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: compiler |
-=> Neil Heller wrote to William McBrine <=-
NH> If I were to build an application using shared libraries, what sorts of
NH> version problems would I run into if the application were to be
NH> distributed far and wide (presumably beyond my control)?
Potentially quite a few. But that's why, on the one hand, systems like .rpm
and .deb were developed; and on the other hand, it's just one more reason
to distribute your application in source code form.
The main differences from Windows here are 1) Windows has only a single
"distribution" for each version, and 2) it's commonplace, or even
customary, for Windows apps to just bundle all the DLLs they'll need, and
install them all -- leading of course to bloated packages and "DLL hell".
In Linux, this would be considered gauche. But instead, you sometimes end
up having to install multiple packages just to get the one you want
running.
Oh, and 3) the version numbering of shared libraries. The advantage here is
that, not only can you have multiple versions of a single library side by
side:
/lib/libncurses.so.4.2
/lib/libncurses.so.5.3
but you can also, via symbolic links, let applications link to the latest
version automatically:
/lib/libncurses.so -> /lib/libncurses.so.5.3
/lib/libncurses.so.5 -> /lib/libncurses.so.5.3
/lib/libncurses.so.4 -> /lib/libncurses.so.4.2
(Most curses apps would link then to libncurses.so; if there were some that
depended on features of specific versions, they could link to one of the
above.)
NH> This compiled to 80kb in debug mode and 24kb in release mode. What
NH> would I need to do to the above file to compile it *nix so that it used
NH> a shared library?
Nothing; that's the default, when shared libraries are available. (Not all
libraries are available in shared form.)
If you want it to use static linking instead -- to avoid the dependency
problems mentioned above -- you can force that on a per-library basis by
specifying the full path to the static (".a" instead of
".so") library; or
make the entire program static-linked via the "-static" command-line
option, in the case of gcc. Of course, the resulting apps are huge, but
this is the only way that I can run the same binaries on my 486 under
Slackware 3.0 (libc5, etc.) and my Athlon under Mandrake 8.0 (glibc2,
etc.). Not that I usually care.
... Press any key... no, no, no, NOT THAT ONE!
--- MultiMail/Linux v0.45
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)SEEN-BY: 633/267 270 @PATH: 106/2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.