Boost logo

Boost :

Subject: Re: [boost] Can't compile code with BOOST_LOG_TRIVIAL
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-06-19 15:39:01


On Wednesday 19 June 2013 10:18:14 ... ... wrote:
> 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 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 ?

You are probably affected by this issue:

http://boost-log.sourceforge.net/libs/log/doc/html/log/rationale/namespace_mangling.html

The missing symbols correspond to a static library while you only have shared
libraries.


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