Subject: Re: [boost] [Log] Problem with Release mode build
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2010-08-31 14:13:30
On 08/31/2010 08:30 AM, Sivaram Kannan wrote:
>> Do I get it right that you built Boost.Log as
> I have a DLL application to which Boost.Log is linked with. I tried
> building the boost with both options linkage=static, linkage=shared.
Ok, if you use dlls you should build Boost.Log as a shared library, too.
>> If so, please elaborate what you mean by "not creating the lg object at
>> all". Does execution reach this line? If not, then what happens before it?
> Execution does reaches this line. But I could not see any instance
> getting created in the Locals tab. I repeat the point that this works
> well in the debug mode.
You mean the Locals tab in the IDE? In release builds (i.e. when
optimization is on) the debugger is often unable to correctly show
variables. In your case the logger variable is probably optimized away
due to NRVO.
If it reaches the logger construction, I'm rather positive that it's not
>> I bet it is somehow related to the Log_Init function you call before it.
> I am not very sure. Here is the function. I am calling this function
> from the BOOST_LOG_DECLARE_GLOBAL_LOGGER_INIT.
> What am I missing here?
Nothing criminal here too. Could you show your logging expression where
the crash occurs?
I'll try to reproduce the problem locally, but it would be very helpful
if you could create a small code sample that crashes.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk