Boost logo

Boost :

Subject: [boost] Can't compile code with BOOST_LOG_TRIVIAL
From: ... ... (bersac_1_at_[hidden])
Date: 2013-06-19 06:18:14


Hi,

I am trying to compile this code :

#include <boost/log/trivial.hpp>
int main(void){ BOOST_LOG_TRIVIAL(trace) << "boost log is working"; return EXIT_SUCCESS;}
And I get the following error message : g++ -o test Capture.o ffmpegTools.o FluxVideoModifie.o test.o vizILogger.o -lavformat -lavcodec -lavutil -lswscale -lopencv_core -lopencv_highgui -lboost_filesystem -lboost_log_setup -lboost_log -lz -lpthread -ldl -lm test.o: In function `main':/home/exploit/git/VIZIRD-CAPTURE/proj/capture//test.cpp:39: undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'/home/exploit/git/VIZIRD-CAPTURE/proj/capture//test.cpp:39: undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'test.o: In function `boost::log::v2s_mt_posix::record::reset()':/usr/local/include/boost/log/core/record.hpp:153: undefined reference to `boost::log::v2s_mt_posix::record_view::public_data::destroy(boost::log::v2s_mt_posix::record_view::public_data const*)'test.o: In function `boost::log::v2s_mt_posix::record boost::log::v2s_mt_posix::sources::basic_composite_logger<char, boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>, boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex>, boost::log::v2s_mt_posix::sources::features<boost::log::v2s_mt_posix::sources::severity<boost::log::v2s_mt_posix::trivial::severity_level>, void, void, void, void, void, void, void, void, void> >::open_record<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> const&)':/usr/local/include/boost/log/sources/basic_logger.hpp:457: undefined reference to `boost::log::v2s_mt_posix::core::get_logging_enabled() const'test.o: In function `~record_pump':/usr/local/include/boost/log/sources/record_ostream.hpp:278: undefined reference to `boost::log::v2s_mt_posix::aux::unhandled_exception_count()'test.o: In function `record_pump':/usr/local/include/boost/log/sources/record_ostream.hpp:259: undefined reference to `boost::log::v2s_mt_posix::aux::stream_provider<char>::allocate_compound(boost::log::v2s_mt_posix::record&)'/usr/local/include/boost/log/sources/record_ostream.hpp:259: undefined reference to `boost::log::v2s_mt_posix::aux::unhandled_exception_count()'test.o: In function `~auto_release':/usr/local/include/boost/log/sources/record_ostream.hpp:243: undefined reference to `boost::log::v2s_mt_posix::aux::stream_provider<char>::release_compound(boost::log::v2s_mt_posix::aux::stream_provider<char>::stream_compound*)'test.o: In function `boost::log::v2s_mt_posix::sources::aux::severity_level<boost::log::v2s_mt_posix::trivial::severity_level>::set_value(boost::log::v2s_mt_posix::trivial::severity_level)':/usr/local/include/boost/log/sources/severity_feature.hpp:135: undefined reference to `boost::log::v2s_mt_posix::sources::aux::get_severity_level()'test.o: In function `boost::log::v2s_mt_posix::record boost::log::v2s_mt_posix::sources::basic_logger<char, boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>, boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex> >::open_record_unlocked<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> const&)':/usr/local/include/boost/log/sources/basic_logger.hpp:260: undefined reference to `boost::log::v2s_mt_posix::core::open_record(boost::log::v2s_mt_posix::attribute_set const&)'test.o: In function `boost::log::v2s_mt_posix::core::push_record(boost::rv<boost::log::v2s_mt_posix::record>&)':/usr/local/include/boost/log/core/core.hpp:308: undefined reference to `boost::log::v2s_mt_posix::core::push_record_move(boost::log::v2s_mt_posix::record&)'collect2: ld returned 1 exit statusmake: *** [test] Error 1

In my makefile I added the links :LIBS_boost = -lboost_filesystem -lboost_log_setup -lboost_log
And i have my libraries correctly installed because the command : $ sudo ldconfig -p | grep boost_l display :libboost_log_setup.so.1.53.0 (libc6,x86-64) => /usr/local/lib/libboost_log_setup.so.1.53.0libboost_log_setup.so (libc6,x86-64) => /usr/local/lib/libboost_log_setup.solibboost_log.so.1.53.0 (libc6,x86-64) => /usr/local/lib/libboost_log.so.1.53.0libboost_log.so (libc6,x86-64) => /usr/local/lib/libboost_log.solibboost_locale.so.1.53.0 (libc6,x86-64) => /usr/local/lib/libboost_locale.so.1.53.0libboost_locale.so (libc6,x86-64) => /usr/local/lib/libboost_loc

Can you help me please ?

Thanks,Guillaume Bersac237bis rue de Pessac33000 Bordeaux06.65.30.89.43
                                                                                              


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