Boost logo

Boost Users :

From: Nathan McDaniel (n.j01_at_[hidden])
Date: 2007-03-17 08:59:41


Hi Jeff,

Note in the "Automatic Linking on Windows" section of the Getting Started
guide ( http://www.boost.org/more/getting_started.html) that there are only
a few Boost libraries that require you to link against link libraries. (See
http://www.boost.org/libs/libraries.htm for all Boost libraries). All of
the other Boost libraries you just need to include the header files.

> If so, is there any way to have
> a single copy of the libraries and statically link different applications
> to
> the same library instead of creating a copy of the boost libs for each
> app?
>

Yes, multiple projects can reference the same copy of the link libraries.

You generally will only need to build the boost libraries once, and can then
reuse them from project to project (assuming you're using the same runtime
library settings from project to project). Note that a better option may be
to just download the already built libraries (includes headers) from:
http://www.boost-consulting.com/download.html. Run the "installer" and then
select the "Variant" options you need (the need to match the runtime library
settings that you are using for your project to avoid link errors). I've
only looked at this installer for the first time today, but it appears to be
rather nifty

Once you've got the libraries, there are only two project settings you'll
need to set in Visual Studio.
1. Right click your project to get the "Project Property Pages".
2. Select "C/C++ (General)", and enter the path to the boost header files
in "Additional Include Directories".
3. Select "Linker (General)", and enter the path to the boost library files
in "Additional Library Directories".

Nathan

P.S. I like to put all as much of my project settings as possible
into Property Sheets, see
http://msdn2.microsoft.com/en-us/library/a4xbdz1e(VS.80).aspx
 for more info.

On 3/16/07, Jeff Dunlap <jeff_j_dunlap_at_[hidden] > wrote:
>
>
> Thanks for your response. I'm new to VC++ and don't know how libs are
> configured for use in VC. Do you first make a brand new copy of the built
>
> boost libraries each time you make a new application, then configure your
> application to reference the boost libraries? If so, is there any way to
> have
> a single copy of the libraries and statically link different applications
> to
> the same library instead of creating a copy of the boost libs for each
> app?
>



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