From: Petr Kocmid (pkocmid_at_[hidden])
Date: 2002-10-16 18:59:16
> On Behalf Of David Abrahams
> I don't think we're answering his question here. Are the components of
> statically-linked libraries which link to a static runtime built any
> differently from those which link to a dynamic runtime? Are they
> linked (Windows) or archived (Unix) any differently? I think the
> answer on Unix is no in both cases. I'm not sure about Windows.
On native windows, answer is yes. Consider, that for VC6 there is at least
six different switches for code generation to call runtime libraries:
/ML single threaded, static runtime
/MT multithreaded, static runtime
/MD multithreaded, dynamic runtime, usualy used for DLL builds
/MLd /MTd /MDd the same for debug build
Generally, you must compile a unit with appropriate switch to link properly
with desired library later on. For a user of a single library, you have to
build a six different .lib files + two dlls for one optimized processor
architecture. You MUST have this switch consistent across all units in one
library+application target. And, calling convention is yet another story...
Alkis, you should understand, that on win32 there is, in case of C++ binding
AND VC compatible compilers, a static library for static linkage and a
dynamic library AND static import library of this dynamic library for
dynamic linkage. There is no dynamic linker on win32 as it is in Linux, only
dynamic loader, so bindings to dynamic names are 'statically' resolved
through import library glue code. The big difference is that unix shared
libraries are much easier to use and lower on memory consumption, but slower
to initialize than win32 ones.
With cygwin or Borland tools, dll things are little more complicated...
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk