I am trying to get Boost.Log in my project. The problem occurs in the following line from a trivial example:
using namespace boost::log; core::get()->set_filter ( trivial::severity >= trivial::info );
In my code, this means the following:
boost::log::core::get()->set_filter( boost::log::trivial::severity >= boost::log::trivial::info );
However, I get the following errors:
error C2039: 'severity' : is not a member of 'boost::log::v2s_mt_nt5::trivial' error C2065: 'severity' : undeclared identifier
I kind of looked around namespaces, trying to figure out how I should do this, but I really can't find anything that works. This seems to require some kind of crazy lambda function. I'm fine with some kind of alternative (defining a function that fills the filtering level?), But I'm not sure how to do this. Any ideas?
I am using Boost.Log version 2.0-r862 and Boost 1.53.0.
SOLUTION Ryan pointed out that I should check my included data, and of course I only included trivial.hpp , but there should also be core.hpp and expressions.hpp . Including they solved the problem.
// need at least these 3 to get "trivial" to work #include <boost/log/core.hpp> #include <boost/log/expressions.hpp> #include <boost/log/trivial.hpp>
source share