Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2008-01-07 13:11:19


Lizheng wrote:
>> I download the precompiled static boost librarys from
>> boost-consulting website,I found there is more than one "lib" files
>> for a boost library,for example "regex" library,there exist below
>> ".lib" files:
>> - libboost_regex-vc80-mt-1_34_1.lib;
>> - libboost_regex-vc80-mt-gd-1_34_1.lib;
>> - libboost_regex-vc80-mt-s-1_34_1.lib;
>> - libboost_regex-vc80-mt-sgd-1_34_1.lib;
>> - libboost_regex-vc80-s-1_34_1.lib;
>> - libboost_regex-vc80-sgd-1_34_1.lib;
>> so what is the function of the files?

It is a fact of life with VC++ that you must link to a library that was
built against the same runtime library options (Under Properties->C++ ->Code
Generation -> Runtime Library in your IDE) that your project is using.
Hence there is one library for each possible variant build variant For some
there are both static libraries (which have file names starting with "lib")
and dll's.

>> I most use VC8 and MFC to write
>> my program,so which ".lib" file my program linked?

If you define BOOST_LIB_DIAGNOSTIC when building then you will see a message
when compiling that indicates which library has been selected.

>> If I want my
>> program to link with a boost dll library,how can I do?
> Version: 7.5.516 / Virus Database: 269.17.13/1212 - Release Date:
> 06/01/2008 22:55

Define either BOOST_REGEX_DYN_LINK or BOOST_ALL_DYN_LINK in your project
settings #defines to force your code to use the dll rather than static
library builds.

HTH, John.


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