Boost logo

Boost Users :

From: Andrew Holden (aholden_at_[hidden])
Date: 2006-12-08 12:29:49


Sohail Somani wrote:
>
> [mailto:boost-users-bounces_at_[hidden]] On Behalf Of
> > Vladimir Prus
>
> > I suppose because on Linux, it's not typical to have several
> > variants. And
> > if you have just one variant, using
> >
> > -lwhatever
>
> Is it typical on Windows because of the way Microsoft set up the C++
> runtime libraries?
>
> I can't recall ever seeing a single-threaded version of the g++
> runtimes.

That's pretty much it. Each Microsoft compiler includes multiple
versions of the runtime library, and it can be a severe problem if
different modules in your program autolink to different versions.
Imagine the heap corruption if you use the release malloc to allocate a
variable and the debug free to release it.

The problem is actually somewhat reduced in Visual Studio 8. It now
only has 4 versions of the C runtime (all combinations of debug or
release, static or dynamic, multithreaded only). Previous versions also
had single-threaded, static runtime libraries.

You can also run into problems by linking a library compiled with, say,
Visual Studio 7 with a program compiled with Visual Studio 8, as each
version has its own set of runtime libraries. Fortunately, this tends
to be a moot point with C++, as the function name mangling changes from
one version of the compiler to the next, so the link will probably fail
anyway.

Fortunately, UNIX doesn't have such a schizophrenic runtime library, so
you're pretty much assured of compatibility.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net