Boost logo

Boost Users :

Subject: Re: [Boost-users] Linking boost in Visual Studio VC++ project
From: Norbert Wenzel (norbert.wenzel.lists_at_[hidden])
Date: 2010-03-26 06:44:45


2010/3/26 Federico Golfrè Andreasi <federico.golfre_at_[hidden]>

> Hi !
>
> I'm trying to find out how to link boost libraries under windows to a
> visual studio VC++ project (that will be a .dll library).
>
> Where can I find some information ?!
>

I've take that from an old doc, but I assume the flag is still the same.

"If you are linking to a dynamic runtime, then you can choose to link to
either a static or a dynamic Boost library, the default is to do a static
link. You can alter this for a specific library *whatever* by defining
BOOST_WHATEVER_DYN_LINK to force Boost library *whatever* to be linked
dynamically. Alternatively you can force all Boost libraries to dynamic
link by defining BOOST_ALL_DYN_LINK."
from: http://www.boost.org/doc/libs/1_33_1/more/getting_started.html

> I've compiled the boost libraries and followed the instruction found at:
> http://www.boost.org/doc/libs/1_35_0/more/getting_started/windows.html
>
> but when I build the project it gives me an error trying to find a
> libboost_filesystem-vc80-mt-gd-1_41.lib,
> but no one libraries build starts with the 'lib' prefix ?
> Why he search for them ?
>

By default (I think it is default) Boost will autolink the static libraries,
which are named (on Windows) libboost_something.lib. So you will have to
tell Boost it should link to dynamic libraries. (See the quotation above).

regards,
Norbert



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