
Hi, On further investigation, I have narrowed down the issue to this line. sources::wseverity_logger_mt<> &lg = ::get_my_log(); <================ This line is not returning the lg object from Global Macro. BOOST_LOG_DECLARE_GLOBAL_LOGGER_INIT(my_log, sources::wseverity_logger_mt<>) { Log_Init(); sources::wseverity_logger_mt<> lg; return lg; } This is not working properly only in release mode and working well in debug mode. Environment I am using is VC++ 2008. What am I missing?? Thanks, Siva. On Thu, Aug 26, 2010 at 6:02 PM, Sivaram Kannan <siva.devel@gmail.com> wrote:
Hi,
I have been using boost log with two of my projects, one an VC++ 2008 exe and another a VC++ DLL. Boost log was working as expected in the Debug mode. But when I compiled the projects in release mode, the boost log with the exe is not logging anything on the file and the dll is creating an access violation. Following is the call stack which is throwing the error.
cnbc.dll!boost::log_mt_nt5::sources::basic_logger<wchar_t,boost::log_mt_nt5::sources::wseverity_logger_mt<int>,boost::log_mt_nt5::sources::multi_thread_model<boost::shared_mutex>
::open_record_unlocked<boost::parameter::aux::tagged_argument<boost::log_mt_nt5::keywords::tag::severity,enum severity const > >(const boost::parameter::aux::tagged_argument<boost::log_mt_nt5::keywords::tag::severity,enum severity const > & args={...}) Line 269 + 0x15 bytes C++ cnbc.dll!boost::log_mt_nt5::sources::basic_severity_logger<boost::log_mt_nt5::sources::basic_logger<wchar_t,boost::log_mt_nt5::sources::wseverity_logger_mt<int>,boost::log_mt_nt5::sources::multi_thread_model<boost::shared_mutex> ,int>::open_record_unlocked<boost::parameter::aux::tagged_argument<boost::log_mt_nt5::keywords::tag::severity,enum severity const > >(const boost::parameter::aux::tagged_argument<boost::log_mt_nt5::keywords::tag::severity,enum severity const > & args={...}) Line 226 + 0xc bytes C++ cnbc.dll!boost::log_mt_nt5::sources::basic_composite_logger<wchar_t,boost::log_mt_nt5::sources::wseverity_logger_mt<int>,boost::log_mt_nt5::sources::multi_thread_model<boost::shared_mutex>,boost::mpl::vector1<boost::log_mt_nt5::sources::severity<int>
::open_record<boost::parameter::aux::tagged_argument<boost::log_mt_nt5::keywords::tag::severity,enum severity const > >(const boost::parameter::aux::tagged_argument<boost::log_mt_nt5::keywords::tag::severity,enum severity const > & args={...}) Line 509 + 0x14 bytes C++
I have compiled the boost in release mode and as shared. Following is the command I used. , .\bjam.exe --with-log --with-filesystem --with-system --with-date_time --with-thread --with-regex define=BOOST_ALL_DYN_LINK variant=release link=shared stage
What am i doing wrong here??
Thanks, Siva.
.