
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 get the error message LINK : fatal error LNK1104: cannot open file 'libboost_iostreams-vc100-mt-1_49.lib' What might the problem be?

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. MSVC let's you do this - which is probably OK if you really watch what you're doing. But I think boost library creation either discourgages or prohibits this. Hence the library that is being requested via auto-linking doesn't exist and you get the error message. Robert Ramey
I get the error message
LINK : fatal error LNK1104: cannot open file 'libboost_iostreams-vc100-mt-1_49.lib'
What might the problem be?

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@acc.umu.se

Lars Viklund wrote:
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.
This is what I meant
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.
I guess I'm confused about building boost with link=static runtime-link=shared which I take to mean that the library is created as a DLL (runtime-link=shared) but linked as a static (link=static) which would include some functions in the CRT twice - once inside the DLL and again when the the library which uses the DLL refers to the same function. I'm guessing that boost build won't build a DLL with a static linked CRT for just this reason. I concede I'm confused about this.
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.

On Sun, Feb 26, 2012 at 12:28:59PM -0800, Robert Ramey wrote:
Lars Viklund wrote:
Statically linking a library that uses a dynamic runtime is perfectly sane.
I guess I'm confused about building boost with
link=static runtime-link=shared
which I take to mean that the library is created as a DLL (runtime-link=shared) but linked as a static (link=static) which would include some functions in the CRT twice - once inside the DLL and again when the the library which uses the DLL refers to the same function. I'm guessing that boost build won't build a DLL with a static linked CRT for just this reason.
I concede I'm confused about this.
The 'link' option is about the flavor of library, static or shared, that your library itself is. The 'runtime-link' option is about which flavor of C++ runtime, static or dynamic, that is linked into the library/application you're building. See [1] and [2] for the filename decorations caused by these options and their verbatim meaning. [1] http://www.boost.org/doc/libs/1_49_0/more/getting_started/windows.html#libra... [2] http://www.boost.org/doc/libs/1_49_0/more/getting_started/unix-variants.html... -- Lars Viklund | zao@acc.umu.se
participants (3)
-
Johan Råde
-
Lars Viklund
-
Robert Ramey