undefined reference to `boost::log::v2_mt_posix::...
Hello I face this error and I cannot figure out a fix. I use bjam to build the application code, and inside site-config file, I have also the following a section where I define BOOST_ALL_DYN_LINK: ''' using gcc : : : where I have defined <define> BOOST_ALL_DYN_LINK ''' I have build boost libraries with the following command: sudo bjam toolset=gcc --with-system --with-thread --with-timer --with-chrono --with-filesystem --with-program_options --with-timer *--with-log* --with-program_options --with-date_time --with-math --with-serialization --with-regex --with-chrono --with-atomic runtime-link=shared define=*BOOST_ALL_DYN_LINK* --prefix=/opt/boost_shared install | tee output.txt I also changed some files (macro definitions and jam files) because I had an error that system and filesystem are configured to be compiled both as static and shared. I compiled them as shared. When I build the application code, I have plenty of `boost::log::v2_mt_posix::...` error messages. Could you give me some guide why this problem exist? Thanks, Antonis
On 29/09/2018 01:03, Antonis Polykratis wrote:
I face this error and I cannot figure out a fix. I use bjam to build the application code, and inside site-config file, I have also the following a section where I define BOOST_ALL_DYN_LINK: ''' using gcc : : : where I have defined <define> BOOST_ALL_DYN_LINK [...] When I build the application code, I have plenty of `boost::log::v2_mt_posix::...` error messages.
Could you give me some guide why this problem exist?
Firstly, BOOST_ALL_DYN_LINK is something that you define when including Boost in your application. It has no effect on the compilation of Boost itself. Secondly, it's an auto-linking property, and auto-linking is only implemented on Windows MSVC. It's harmless to define it when building a Linux or other GCC application, but it will have no effect. With gcc/clang, you must explicitly add -l parameters for each Boost non-header-only library (and dependency thereof) which you are using.
participants (2)
-
Antonis Polykratis
-
Gavin Lambert