Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2007-04-21 04:36:21


Metasebia Moges wrote:
>> Like I said in an earlier e-mail, the code is isolated. However, to
>> make things sure I added it as: #define BOOST_REGEX_DYN_LINK in the
>> source code and there is no change.
>> Then I defined it in Properties->Preprocessor Definitions. Then it
>> complains as: "Mixing a Boost dll with a static runtime is a really
>> bad idea ...". I don't know why?

That's hint as to where the problem may be: it is in general a really bad
idea to use the static C++ runtime library in a dll (unless you're *very*
careful about what interfaces are exposed), and you cannot use regex as a
dll with a static C++ runtime. The problem is that your application gets
two different runtime libraries, which can lead to all kinds of hard to
trace memory errors: this is a Win32 not a Boost issue.

>>> Other than that it's hard to say what the issue might be without
>>> seeing your code.
>>
>> The surprising thing is that a single line of BOOST code (just an
>> expression) disturbs the program. For example, I added:
>> boost::regex sre("!NULL|sil|SIL");
>> only and didn't do anything with it. Then when I run the program
>> with the perfectly working code (non-boost), it misbehaves. So I
>> don't think it is a problem with my regex code as all.

That sounds like a possible runtime-library problem. Can you switch both
your application and the dll to use the dynamic C++ runtime?

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