Boost logo

Boost Users :

Subject: [Boost-users] Help me out from boost.log
From: Steven Woody (narkewoody_at_[hidden])
Date: 2011-01-21 12:42:25


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
...

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)
....

Please help me! Thanks in advance.

-- 
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer
narke
public key at http://subkeys.pgp.net:11371 (narkewoody_at_[hidden])

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