Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2007-03-30 04:16:42


llwaeva_at_[hidden] wrote:
> Hi there,
> I am writing a DLL under Windows with MSVC 2005. In my project,
> boost:regex is involved. I do nothing but include the following in my
> stdafx.h
>
> #include <boost/regex.hpp>
> #include <boost/regex/v4/match_flags.hpp>
> #include <boost/scoped_ptr.hpp>
> #include <boost/compressed_pair.hpp>
> #include <boost/format.hpp>
> #include <boost/algorithm/string/regex.hpp>
> #include <boost/algorithm/string/regex_find_format.hpp>
> #include <boost/algorithm/string/replace.hpp>
> #include <boost/algorithm/string/split.hpp>
> #include <boost/algorithm/string.hpp>
> #include <boost/algorithm/string_regex.hpp>
> #include <boost/algorithm/string/trim.hpp>
> #include <fstream>
> #include <sstream>
> #include <string>
> #include <vector>
>
> it is all right to complie the project once I specify the path of the
> library of boost::regex. I found there are librarys in the directory
> libboost_regex-vc80-mt-s-1_33_1.lib and libboost_regex-vc80-mt-s.lib
>
> I wonder what's different between these two librarys? Which one
> should I
> used to develope a DLL?

One links to the dll regex build and one to the static regex lib. Which you
use depends on how your dll is to be used: if all uses of Boost.Regex are
internal to the dll then you can just use the static lib (the default
option). If Boost.Regex usage escapes from the dll (either it's used
elsewhere in the application or Boost.Regex types appear in the dll's
API's), then use the dll version of regex. To do that you will need to
define BOOST_REGEX_DYN_LINK before including boost/regex.hpp and the
auto-linking code will then pick up on the dll import lib and do everything
for you.

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