Boost logo

Boost Users :

Subject: Re: [Boost-users] Help me out from boost.log
From: Tarcisio Fedrizzi (tarcisio.fedrizzi_at_[hidden])
Date: 2011-01-21 13:06:33


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<boost/log/core.hpp>
> #include<boost/log/trivial.hpp>
> #include<boost/log/filters.hpp>
>
>
> 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::attr<logging::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_at_system@boost@@YAABVerror_category_at_12@XZ) referenced
> in function "void __cdecl boost::system::`dynamic initializer for
> 'posix_category''(void)" (??__Eposix_category_at_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.


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