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?I most use VC8 and MFC to write my program,so which ".lib" file my program linked?If I want my program to link with a boost dll library,how can I do?
I download the precompiled static boost librarys from boost-consulting website,I found there is more than one "lib" files for a boost
Lizheng [pango99@tom.com] wrote: 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?I most use VC8 and MFC to write my program,so which ".lib" file my program linked?If I want my program to link with a boost dll library,how can I do?
Please see http://www.boost.org/more/getting_started/windows.html#library-naming for a description of those library names. I think you can get the dll versions by defining BOOST_REGEX_DYN_LINK or BOOST_ALL_DYN_LINK before including regex.hpp. I would personally recommend setting it in your project options to ensure all translation units call for the same version of the library. I got this information by looking through the source; can somebody verify it and/or link the documentation page.
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.
participants (3)
-
Andrew Holden
-
John Maddock
-
Lizheng