libbitcoin/libbitcoin-explorer

undefined reference to 'boost::log::v2s_mt_posix::aux::once_block_sentry::rollback()'

Closed this issue · 10 comments

$ sudo ./install.sh --build-qrencode --with-qrencode --build-icu --with-icu --build-png --with-png --build-zlib --build-boost --with-boost --build-zmq --build-icu --with-icu --disable-shared --with-bash-completion-dir
...
/usr/bin/ld: /usr/local/lib/libbitcoin-system.a(libbitcoin_system_la-sink.o): in function `boost::log::v2s_mt_posix::visitation_result boost::log::v2s_mt_posix::value_visitor_invoker<boost::mpl::vector2<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, boost::log::v2s_mt_posix::fallback_to_none>::operator()<boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::expressions::aux::stream_ref<boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> > >&> >(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&, boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::expressions::aux::stream_ref<boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> > >&>) const':
/usr/local/include/boost/log/attributes/value_visitation.hpp:191: undefined reference to `boost::log::v2s_mt_posix::aux::attach_attribute_name_info(boost::exception&, boost::log::v2s_mt_posix::attribute_name const&)'
/usr/bin/ld: /usr/local/lib/libbitcoin-system.a(libbitcoin_system_la-sink.o): in function `boost::enable_if_c<(boost::log::v2s_mt_posix::aux::is_character_type<wchar_t>::value&&boost::log::v2s_mt_posix::aux::is_character_type<char>::value)&&((sizeof (wchar_t))!=(sizeof (char))), bool>::type boost::log::v2s_mt_posix::aux::code_convert<wchar_t, char, std::char_traits<char>, std::allocator<char> >(wchar_t const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned long, std::locale const&)':
/usr/local/include/boost/log/detail/code_conversion.hpp:133: undefined reference to `boost::log::v2s_mt_posix::aux::code_convert_impl(wchar_t const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned long, std::locale const&)'
/usr/bin/ld: /usr/local/include/boost/log/detail/code_conversion.hpp:133: undefined reference to `boost::log::v2s_mt_posix::aux::code_convert_impl(wchar_t const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned long, std::locale const&)'
/usr/bin/ld: /usr/local/include/boost/log/detail/code_conversion.hpp:133: undefined reference to `boost::log::v2s_mt_posix::aux::code_convert_impl(wchar_t const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned long, std::locale const&)'
/usr/bin/ld: /usr/local/lib/libbitcoin-system.a(libbitcoin_system_la-sink.o): in function `void boost::log::v2s_mt_posix::sinks::basic_sink_frontend::flush_backend_impl<boost::recursive_mutex, boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char> >(boost::recursive_mutex&, boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>&, mpl_::bool_<true>)':
/usr/local/include/boost/log/sinks/basic_sink_frontend.hpp:230: undefined reference to `boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>::flush()'
/usr/bin/ld: /usr/local/lib/libbitcoin-system.a(libbitcoin_system_la-sink.o): in function `void boost::log::v2s_mt_posix::sinks::basic_sink_frontend::flush_backend_impl<boost::recursive_mutex, boost::log::v2s_mt_posix::sinks::text_file_backend>(boost::recursive_mutex&, boost::log::v2s_mt_posix::sinks::text_file_backend&, mpl_::bool_<true>)':
/usr/local/include/boost/log/sinks/basic_sink_frontend.hpp:230: undefined reference to `boost::log::v2s_mt_posix::sinks::text_file_backend::flush()'
/usr/bin/ld: /usr/local/lib/libbitcoin-system.a(libbitcoin_system_la-sink.o): in function `void boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::feed_record<boost::recursive_mutex, boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char> >(boost::log::v2s_mt_posix::record_view const&, boost::recursive_mutex&, boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>&)':
/usr/local/include/boost/log/sinks/basic_sink_frontend.hpp:463: undefined reference to `boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>::consume(boost::log::v2s_mt_posix::record_view const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /usr/local/lib/libbitcoin-system.a(libbitcoin_system_la-sink.o): in function `void boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::feed_record<boost::recursive_mutex, boost::log::v2s_mt_posix::sinks::text_file_backend>(boost::log::v2s_mt_posix::record_view const&, boost::recursive_mutex&, boost::log::v2s_mt_posix::sinks::text_file_backend&)':
/usr/local/include/boost/log/sinks/basic_sink_frontend.hpp:463: undefined reference to `boost::log::v2s_mt_posix::sinks::text_file_backend::consume(boost::log::v2s_mt_posix::record_view const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /usr/local/lib/libbitcoin-system.a(libbitcoin_system_la-sink.o): in function `void boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::feed_record<boost::log::v2s_mt_posix::aux::fake_mutex, boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char> >(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::aux::fake_mutex&, boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>&)':
/usr/local/include/boost/log/sinks/basic_sink_frontend.hpp:463: undefined reference to `boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>::consume(boost::log::v2s_mt_posix::record_view const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /usr/local/lib/libbitcoin-system.a(libbitcoin_system_la-sink.o): in function `void boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::feed_record<boost::log::v2s_mt_posix::aux::fake_mutex, boost::log::v2s_mt_posix::sinks::text_file_backend>(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::aux::fake_mutex&, boost::log::v2s_mt_posix::sinks::text_file_backend&)':
/usr/local/include/boost/log/sinks/basic_sink_frontend.hpp:463: undefined reference to `boost::log::v2s_mt_posix::sinks::text_file_backend::consume(boost::log::v2s_mt_posix::record_view const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /usr/local/lib/libbitcoin-system.a(libbitcoin_system_la-file_collector_repository.o): in function `boost::log::v2s_mt_posix::aux::once_block_sentry::executed() const':
/usr/local/include/boost/log/utility/once_block.hpp:91: undefined reference to `boost::log::v2s_mt_posix::aux::once_block_sentry::enter_once_block() const'
/usr/bin/ld: /usr/local/lib/libbitcoin-system.a(libbitcoin_system_la-file_collector_repository.o): in function `boost::log::v2s_mt_posix::aux::lazy_singleton<libbitcoin::system::log::file_collector_repository, boost::shared_ptr<libbitcoin::system::log::file_collector_repository> >::get()':
/usr/local/include/boost/log/detail/singleton.hpp:43: undefined reference to `boost::log::v2s_mt_posix::aux::once_block_sentry::commit()'
/usr/bin/ld: /usr/local/lib/libbitcoin-system.a(libbitcoin_system_la-file_collector_repository.o): in function `boost::log::v2s_mt_posix::aux::once_block_sentry::~once_block_sentry()':
/usr/local/include/boost/log/utility/once_block.hpp:86: undefined reference to `boost::log::v2s_mt_posix::aux::once_block_sentry::rollback()'
/usr/bin/ld: /usr/local/lib/libbitcoin-system.a(libbitcoin_system_la-file_collector_repository.o): in function `boost::log::v2s_mt_posix::aux::once_block_sentry::executed() const':
/usr/local/include/boost/log/utility/once_block.hpp:91: undefined reference to `boost::log::v2s_mt_posix::aux::once_block_sentry::enter_once_block() const'
/usr/bin/ld: /usr/local/lib/libbitcoin-system.a(libbitcoin_system_la-file_collector_repository.o): in function `boost::log::v2s_mt_posix::aux::lazy_singleton<libbitcoin::system::log::file_collector_repository, boost::shared_ptr<libbitcoin::system::log::file_collector_repository> >::get()':
/usr/local/include/boost/log/detail/singleton.hpp:43: undefined reference to `boost::log::v2s_mt_posix::aux::once_block_sentry::commit()'
/usr/bin/ld: /usr/local/lib/libbitcoin-system.a(libbitcoin_system_la-file_collector_repository.o): in function `boost::log::v2s_mt_posix::aux::once_block_sentry::~once_block_sentry()':
/usr/local/include/boost/log/utility/once_block.hpp:86: undefined reference to `boost::log::v2s_mt_posix::aux::once_block_sentry::rollback()'
collect2: error: ld returned 1 exit status
make: *** [Makefile:2224: console/bx] Error 1

What I am missing?

When I've installed with:

sudo ./install.sh --with-icu --build-icu --build-boost --disable-shared

also fails.

I'm not sure, but the CI builds test the full set of configuration options via the installer.

What is your build platform?

What is your build platform?

OS: Ubuntu 20.10

Should be supported, nothing comes to mind. Maybe avoid sudo and use an isolated build directory to which your user account has permissions.

Given this newer issue, is this issue still open? If not, what resolved it, just a change to shared build? Again, I recommend against using sudo and system directories.

Before the errors, I've manage to build it successfully (so I had all the dependencies installed before), but then I've decided to add some extra flags for ./install.sh to add ICU, then it started failing. I'll try few more combinations.

ICU is a monster dependency. I'm working on phasing it out.

FYI, you should not attempt to reuse installed dependencies as you change build configurations. The installer is designed to build from one empty directory into another. Which is one of the reasons I suggest you avoid sudo and system directories.

FYI, you should not attempt to reuse installed dependencies as you change build configurations. The installer is designed to build from one empty directory into another. Which is one of the reasons I suggest you avoid sudo and system directories.

When I run without sudo, this error happens:

$ ./install.sh
...
make[1]: Entering directory 'libbitcoin-explorer/build-libbitcoin-explorer/secp256k1'
 /bin/mkdir -p '/usr/local/lib'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   libsecp256k1.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libsecp256k1.so.0.0.0 /usr/local/lib/libsecp256k1.so.0.0.0
/usr/bin/install: cannot remove '/usr/local/lib/libsecp256k1.so.0.0.0': Permission denied
make[1]: *** [Makefile:891: install-libLTLIBRARIES] Error 1
make[1]: Leaving directory 'libbitcoin-explorer/build-libbitcoin-explorer/secp256k1'
make: *** [Makefile:1623: install-am] Error 2

So it's trying to access '/usr/local and install in /usr/local/lib.

Of course, you need to direct it to a directory that your user account has permissions to. See --build-dir and --prefix-dir