|
Boost Users : |
Subject: Re: [Boost-users] Linking problem
From: Lars Viklund (zao_at_[hidden])
Date: 2012-02-26 13:14:58
On Sun, Feb 26, 2012 at 08:26:32AM -0800, Robert Ramey wrote:
> Johan R?de wrote:
> > I built Boost with the command
> >
> > b2 toolset=msvc-10.0 address-model=32 link=static runtime-link=shared
> > threading=multi stage
> >
> > I'm linking statically with Boost and dynamically with the CRT
> > (compiler option /MD).
>
> I think this is a problem. At one time attempting to do this
> provoked an error message "... is really a bad idea". This is
> because that portions of the CRT library would show up in
> both the DLL (static link of library) and the application itself
> which uses the DLL. For certain CRT functions which have
> side effects this would be a problem. There might be some
> other problems as well which I don't know about.
It's the other way around that's the scary way.
That is, using a static CRT in a dynamic library, as you then have
disjoint instances of the CRT in both the application and the dynamic
module, leading to split views of things like the free store, file
handles, etc. The net effect of doing it the scary way is that you
cannot share pretty much anything standard-library-like across the
border.
Statically linking a library that uses a dynamic runtime is perfectly
sane.
> > LINK : fatal error LNK1104: cannot open file
> > 'libboost_iostreams-vc100-mt-1_49.lib'
> >
> > What might the problem be?
Does this file exist in your library search path?
Ensure that the headers you use (1.49.0, it seems) match the libraries
you've got.
-- Lars Viklund | zao_at_[hidden]
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