Boost logo

Boost :

Subject: [boost] [log] link problems with keywords::format
From: Michael Caisse (boost_at_[hidden])
Date: 2010-02-27 18:38:53


Using msvc 8 I am having a link issue with the following
code snippet. Commenting out the line with blog::keywords::format
will cause the link error to go away.

---------------------------------------------------
#include <iostream>

#include <boost/log/attributes.hpp>
#include <boost/log/common.hpp>
#include <boost/log/core.hpp>
#include <boost/log/exceptions.hpp>
#include <boost/log/filters.hpp>
#include <boost/log/formatters.hpp>
#include <boost/log/sinks.hpp>
#include <boost/log/trivial.hpp>

#include <boost/log/utility/init/to_file.hpp>
#include <boost/log/utility/init/common_attributes.hpp>

namespace blog = boost::log ;

int main()
{
   blog::init_log_to_file( blog::keywords::file_name = "foo_%N.log",
                           blog::keywords::rotation_size = 10 * 1024 * 1024,
                           blog::keywords::format = "[%TimeStamp%]: %_%",
                           blog::keywords::open_mode = std::ios_base::app );

   BOOST_LOG_TRIVIAL(trace) << "A trace severity message";

   return 0;
}
------------------------------------------------------

main.obj : error LNK2019: unresolved external symbol "class boost::function2<void,class std::basic_ostream<char,struct std::char_traits<char> > &,class boost::log_mt_nt5::basic_record<char> const &> __cdecl boost::log_mt_nt5::parse_formatter<char>(char const *,char const *)" (??$parse_formatter_at_D@log_mt_nt5_at_boost@@YA?AV?$function2_at_XAAV?$basic_ostream_at_DU?$char_traits_at_D@std@@@std@@ABV?$basic_record_at_D@log_mt_nt5_at_boost@@@1_at_PBD0@Z) referenced in function "class boost::function2<void,class std::basic_ostream<char,struct std::char_traits<char> > &,class boost::log_mt_nt5::basic_record<char> const &> __cdecl boost::log_mt_nt5::parse_formatter<char>(char const *)" (??$parse_formatter_at_D@log_mt_nt5_at_boost@@YA?AV?$function2_at_XAAV?$basic_ostream_at_DU?$char_traits_at_D@std@@@std@@ABV?$basic_record_at_D@log_mt_nt5_at_boost@@@1_at_PBD@Z)
bin\msvc-8.0\release\threading-multi\trivial.exe : fatal error LNK1120: 1 unresolved externals

------------------------------------------------------

Any ideas?
michael

-- 
----------------------------------
Michael Caisse
Object Modeling Designs
www.objectmodelingdesigns.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk