On 21/01/2011 18:42, Steven Woody wrote:
Hi, Hi, I want to use boost.log and I succeeded in building it with bjam with Visual Studio 2005. But I quickly found I cannot use it.
Below code are from the tutorial,
#include
#include #include logging::core::init_log_to_file( keywords::file_name = "dsttest_%N.log", keywords::rotation_size = 10 * 1024 * 1024, keywords::time_based_rotation = sinks::file::rotation_at_time_point(0, 0, 0), keywords::format = "[%TimeStamp%]: %_%" ); logging::core::get()->set_filter( flt::attrlogging::trivial::severity_level("Severity") >= loggin::trivial::debug );
but the compiler (vc++ 8.0) just complains:
error C2653: 'logging' : is not a class or namespace name error C2653: 'keywords' : is not a class or namespace name ... look here http://boost-log.sourceforge.net/libs/log/doc/html/log/how_to_read.html I tried to use boost::log::logging, but it did not help.
Then I decided to try the most simple code:
BOOST_LOG_TRIVIAL(debug)<< "hello boost.log";
it passed the compiler but not the linker:
libboost_log-vc80-mt-gd-1_45.lib(trivial.obj) : error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAABVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'posix_category''(void)" (??__Eposix_category@system@boost@@YAXXZ) .... you probably need to link the boost::system library in order to use the log library.
Please help me! Thanks in advance.
Bye, Tarch.