libbitcoin / libbitcoin-client

Bitcoin Client Query Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compile errors: cannot include bitcoin.hpp and client.hpp

slyraccoon-wb opened this issue · comments

Is it intended behaviour for the compiler to fail if including multiple libbitcoin header files? When I run the code below, the compilation fails from the includes, which seems odd. All the examples included in the individual components of libbitcoin, e.g. libbitcoin-client and libbitcoin-server, run fine since they only include a single "#include <bitcoin/something>" however when including more than one it fails.

Can someone let me know what I have done incorrectly?

#include <bitcoin/bitcoin.hpp>
#include <bitcoin/client.hpp>

using namespace bc;

int main(){
    return 1;
}

Compiled via: g++ -std=c++11 -o connect simpleConnect.cpp $(pkg-config --cflags libbitcoin --libs libbitcoin libbitcoin-client)

Compilation errors:

In file included from /usr/local/include/bitcoin/system/formats/base_16.hpp:24:0,
                 from /usr/local/include/bitcoin/system/config/checkpoint.hpp:27,
                 from /usr/local/include/bitcoin/system/chain/chain_state.hpp:26,
                 from /usr/local/include/bitcoin/system/chain/block.hpp:29,
                 from /usr/local/include/bitcoin/system/config/block.hpp:25,
                 from /usr/local/include/bitcoin/system/settings.hpp:22,
                 from /usr/local/include/bitcoin/system.hpp:23,
                 from /usr/local/include/bitcoin/client.hpp:17,
                 from simpleConnect.cpp:2:
/usr/local/include/bitcoin/system/math/hash.hpp:172:8: error: redefinition of ‘struct std::hash<std::array<unsigned char, Size> >’
 struct hash<bc::system::byte_array<Size>>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/bitcoin/bitcoin/formats/base_16.hpp:24:0,
                 from /usr/local/include/bitcoin/bitcoin/config/checkpoint.hpp:27,
                 from /usr/local/include/bitcoin/bitcoin/constants.hpp:25,
                 from /usr/local/include/bitcoin/bitcoin.hpp:19,
                 from simpleConnect.cpp:1:
/usr/local/include/bitcoin/bitcoin/math/hash.hpp:167:8: note: previous definition of ‘struct std::hash<std::array<unsigned char, Size> >’
 struct hash<bc::byte_array<Size>>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/bitcoin/system/formats/base_16.hpp:24:0,
                 from /usr/local/include/bitcoin/system/config/checkpoint.hpp:27,
                 from /usr/local/include/bitcoin/system/chain/chain_state.hpp:26,
                 from /usr/local/include/bitcoin/system/chain/block.hpp:29,
                 from /usr/local/include/bitcoin/system/config/block.hpp:25,
                 from /usr/local/include/bitcoin/system/settings.hpp:22,
                 from /usr/local/include/bitcoin/system.hpp:23,
                 from /usr/local/include/bitcoin/client.hpp:17,
                 from simpleConnect.cpp:2:
/usr/local/include/bitcoin/system/math/hash.hpp:184:8: error: redefinition of ‘struct boost::hash<std::array<unsigned char, Size> >’
 struct hash<bc::system::byte_array<Size>>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/bitcoin/bitcoin/formats/base_16.hpp:24:0,
                 from /usr/local/include/bitcoin/bitcoin/config/checkpoint.hpp:27,
                 from /usr/local/include/bitcoin/bitcoin/constants.hpp:25,
                 from /usr/local/include/bitcoin/bitcoin.hpp:19,
                 from simpleConnect.cpp:1:
/usr/local/include/bitcoin/bitcoin/math/hash.hpp:179:8: note: previous definition of ‘struct boost::hash<std::array<unsigned char, Size> >’
 struct hash<bc::byte_array<Size>>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/bitcoin/system/utility/collection.hpp:120:0,
                 from /usr/local/include/bitcoin/system.hpp:151,
                 from /usr/local/include/bitcoin/client.hpp:17,
                 from simpleConnect.cpp:2:
/usr/local/include/bitcoin/system/impl/utility/collection.ipp:123:15: error: redefinition of ‘template<class Type> std::ostream& std::operator<<(std::ostream&, const std::vector<T>&)’
 std::ostream& operator<<(std::ostream& output, const std::vector<Type>& list)
               ^~~~~~~~
In file included from /usr/local/include/bitcoin/bitcoin/utility/collection.hpp:118:0,
                 from /usr/local/include/bitcoin/bitcoin.hpp:141,
                 from simpleConnect.cpp:1:
/usr/local/include/bitcoin/bitcoin/impl/utility/collection.ipp:115:15: note: ‘template<class Type> std::ostream& std::operator<<(std::ostream&, const std::vector<T>&)’ previously declared here
 std::ostream& operator<<(std::ostream& output, const std::vector<Type>& list)
               ^~~~~~~~
In file included from /usr/local/include/bitcoin/system.hpp:189:0,
                 from /usr/local/include/bitcoin/client.hpp:17,
                 from simpleConnect.cpp:2:
/usr/local/include/bitcoin/system/utility/track.hpp:33:7: error: redefinition of ‘class track<Shared>’
 class track
       ^~~~~
In file included from /usr/local/include/bitcoin/bitcoin.hpp:178:0,
                 from simpleConnect.cpp:1:
/usr/local/include/bitcoin/bitcoin/utility/track.hpp:33:7: note: previous definition of ‘class track<Shared>’
 class track
       ^~~~~
In file included from /usr/local/include/bitcoin/system/utility/track.hpp:46:0,
                 from /usr/local/include/bitcoin/system.hpp:189,
                 from /usr/local/include/bitcoin/client.hpp:17,
                 from simpleConnect.cpp:2:
/usr/local/include/bitcoin/system/impl/utility/track.ipp:36:45: error: redefinition of ‘std::atomic<long unsigned int> track<Shared>::instances’
 std::atomic<size_t> track<Shared>::instances(0);
                                             ^
In file included from /usr/local/include/bitcoin/bitcoin/utility/track.hpp:46:0,
                 from /usr/local/include/bitcoin/bitcoin.hpp:178,
                 from simpleConnect.cpp:1:
/usr/local/include/bitcoin/bitcoin/impl/utility/track.ipp:36:21: note: ‘std::atomic<long unsigned int> track<Shared>::instances’ previously declared here
 std::atomic<size_t> track<Shared>::instances(0);
                     ^~~~~~~~~~~~~
In file included from /usr/local/include/bitcoin/system/utility/track.hpp:46:0,
                 from /usr/local/include/bitcoin/system.hpp:189,
                 from /usr/local/include/bitcoin/client.hpp:17,
                 from simpleConnect.cpp:2:
/usr/local/include/bitcoin/system/impl/utility/track.ipp:39:1: error: redefinition of ‘track<Shared>::track(const string&)’
 track<Shared>::track(const std::string& DEBUG_ONLY(class_name))
 ^~~~~~~~~~~~~
In file included from /usr/local/include/bitcoin/bitcoin/utility/track.hpp:46:0,
                 from /usr/local/include/bitcoin/bitcoin.hpp:178,
                 from simpleConnect.cpp:1:
/usr/local/include/bitcoin/bitcoin/impl/utility/track.ipp:39:1: note: ‘track<Shared>::track(const string&)’ previously declared here
 track<Shared>::track(const std::string& DEBUG_ONLY(class_name))
 ^~~~~~~~~~~~~
In file included from /usr/local/include/bitcoin/system/utility/track.hpp:46:0,
                 from /usr/local/include/bitcoin/system.hpp:189,
                 from /usr/local/include/bitcoin/client.hpp:17,
                 from simpleConnect.cpp:2:
/usr/local/include/bitcoin/system/impl/utility/track.ipp:50:1: error: redefinition of ‘track<Shared>::~track()’
 track<Shared>::~track()
 ^~~~~~~~~~~~~
In file included from /usr/local/include/bitcoin/bitcoin/utility/track.hpp:46:0,
                 from /usr/local/include/bitcoin/bitcoin.hpp:178,
                 from simpleConnect.cpp:1:
/usr/local/include/bitcoin/bitcoin/impl/utility/track.ipp:50:1: note: ‘virtual track<Shared>::~track()’ previously declared here
 track<Shared>::~track()

That code compiles fine for me using a version3 install and this line:

g++ -std=c++11 -o connect simpleConnect.cpp $(pkg-config --cflags --libs libbitcoin-client)

Make sure that your PKG_CONFIG_PATH variable is pointing to the proper libbitcoin installation. You may have conflicting versions in your environment.

Thank you for replying!

my PKG_CONFIG_PATH variable points to a directory with the following listing:

drwxr-xr-x 2 reyez reyez 4096 Jan 4 15:29 .
drwxr-xr-x 5 reyez reyez 4096 Dec 27 17:31 ..
-rw-r--r-- 1 root root 1380 Jan 4 15:19 libbitcoin-blockchain.pc
-rw-r--r-- 1 root root 1363 Jan 3 16:21 libbitcoin-client.pc
-rw-r--r-- 1 root root 1349 Jan 4 15:12 libbitcoin-consensus.pc
-rw-r--r-- 1 root root 1358 Jan 4 15:15 libbitcoin-database.pc
-rw-r--r-- 1 root root 1337 Jan 4 15:23 libbitcoin-network.pc
-rw-r--r-- 1 root root 1347 Jan 4 15:26 libbitcoin-node.pc
-rw-r--r-- 1 reyez reyez 1624 Dec 27 14:33 libbitcoin.pc
-rw-r--r-- 1 root root 1366 Jan 4 15:29 libbitcoin-protocol.pc
-rw-r--r-- 1 root root 1367 Dec 28 22:24 libbitcoin-server.pc
-rw-r--r-- 1 root root 1635 Jan 4 15:12 libbitcoin-system.pc
-rw-r--r-- 1 reyez reyez 340 Dec 27 14:29 libsecp256k1.pc

I thought this was correct, have I got something wrong?

I thought this was correct, have I got something wrong?

Based on your file listing, you've got both an 'old' and a 'new' install of libbitcoin(-system) there. Meaning an install of libbitcoin (before the rename to libbitcoin-system) and also an install of libbitcoin-system. To be safe, I'd re-install the version you want to a new directory, but perhaps it could be as simple as trying this:

  1. Edit your file to include bitcoin/system.hpp instead of bitcoin/bitcoin.hpp.

  2. Run:

g++ -std=c++11 -o connect simpleConnect.cpp $(pkg-config --cflags --libs libbitcoin-system libbitcoin-client)

EDIT: If libbitcoin-client is compatible with libbitcoin-system (which it appears it won't be by the file time stamps), you could just do:

g++ -std=c++11 -o connect simpleConnect.cpp $(pkg-config --cflags --libs libbitcoin-client)

Okay great thanks for clarifying that, I had no idea libbitcoin was replaced by libbitcoin-system! Just to mention, I manually installed each of the libbitcoin libraries since the instructions for libbitcoin-build didn't work for me, hence the timestamps are different.

Just so I do this correctly, I re-install libbitcoin-server. Can you confirm the below steps are correct?

  • Run "sudo make uninstall" for libbitcoin-system's source directory
  • Remove libbitcoin.pc
  • Delete any libbitcoin.* files from /usr/local/lib
  • Delete /usr/local/include/bitcoin/system/ and /usr/local/include/bitcoin/system.hpp

and then re-install libbitcoin-system.

The proper way to install libbitcoin-server summarized from the https://github.com/libbitcoin/libbitcoin-server/blob/master/README.md (and assuming production / version3):

$ wget https://raw.githubusercontent.com/libbitcoin/libbitcoin-server/version3/install.sh
$ chmod +x install.sh
$ ./install.sh --prefix=/home/me/myprefix --build-boost --disable-shared

To install the development version (unstable, but to be version4):

$ wget https://raw.githubusercontent.com/libbitcoin/libbitcoin-server/master/install.sh
$ chmod +x install.sh
$ ./install.sh --prefix=/home/me/myprefix --build-boost --disable-shared

Using a prefix directory is important, to avoid leaving cruft around your system directories and ensuring version conflicts don't happen later. After installation, set your PKG_CONFIG_PATH to be /home/me/myprefix/lib/pkgconfig and all should be well for compiling again.

Sorry if this is a stupid question, but why do I need to re-install libbitcoin-server? I thought it was just libbitcoin-system that was causing my issue?

I have been installing everything by cloning the individual repositories and then cd into the relevant directory that I was installing.

Then I would do one of the two methods (since I couldn't install using the suggested method for all components of libbitcoin)

  1. sudo ./install.sh --prefix=/usr/local --with-pkgconfigdir=/home/reyez/Documents/Software/lib/pkgconfig --with-boost="/home/reyez/Documents/Software/lib"
    or
    2.1) ./autogen.sh;
    2.2) ./configure --prefix=/usr/local --with-pkgconfigdir=/home/reyez/Documents/Software/lib/pkgconfig --with-boost="/home/reyez/Documents/Software/lib"
    2.3) sudo make
    2.4) sudo make install
    2.5) sudo ldconfig

Sorry if this is a stupid question, but why do I need to re-install libbitcoin-server? I thought it was just libbitcoin-system that was causing my issue?

It's not a stupid question, but you know more about your environment than I do. If you're sure all repos are from master and the only thing required is libbitcoin-system, then you know what you need.

The problem with not using the installer is that you don't necessarily get the proper dependencies. Using system dependencies can cause conflicts due to version incompatibilities, etc, even though they might build. I've seen cases of dynamically linking to whatever boost was installed on the system and having compiled programs hang or crash. The installer eliminates these kinds of issues that we really can't support, particularly when statically linked.

Hey @thecodefactory :)

I just removed all traces of libbitcoin and boost and started from scratch, where I tried to follow the steps from your previous comment:

$ wget https://raw.githubusercontent.com/libbitcoin/libbitcoin-server/version3/install.sh
$ chmod +x install.sh
$ ./install.sh --prefix=/home/me/myprefix --build-boost --disable-shared

However, the install.sh script fails when trying to build boost v 1.62, very early on. I manually built v 1.62 by following the vendor instructions, which installed fine. I then ran:
./install.sh --prefix=/usr/local --disable-shared --with-pkgconfigdir=/home/myuser/Documents/Software/lib/pkgconfig --with-boost="/usr/local"

This time the installation doesn't fail immediately, as Boost has successfully built, however I then face the error below (small excerpt from the tailed output):

/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `__static_initialization_and_destruction_0(int, int) [clone .constprop.417]':
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `boost::log::v2s_mt_posix::visitation_result boost::log::v2s_mt_posix::value_visitor_invoker<long, boost::log::v2s_mt_posix::fallback_to_none>::operator()<boost::log::v2s_mt_posix::nop>(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&, boost::log::v2s_mt_posix::nop) const':
/usr/local/include/boost/log/attributes/value_visitation.hpp:182: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const'
/usr/local/include/boost/log/attributes/value_visitation.hpp:183: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::end() 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/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `boost::log::v2s_mt_posix::visitation_result boost::log::v2s_mt_posix::value_visitor_invoker<unsigned long, boost::log::v2s_mt_posix::fallback_to_none>::operator()<boost::log::v2s_mt_posix::nop>(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&, boost::log::v2s_mt_posix::nop) const':
/usr/local/include/boost/log/attributes/value_visitation.hpp:182: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const'
/usr/local/include/boost/log/attributes/value_visitation.hpp:183: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::end() 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/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `boost::log::v2s_mt_posix::visitation_result boost::log::v2s_mt_posix::value_visitor_invoker<std::chrono::duration<long, std::ratio<1l, 1000l> >, boost::log::v2s_mt_posix::fallback_to_none>::operator()<boost::log::v2s_mt_posix::nop>(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&, boost::log::v2s_mt_posix::nop) const':
/usr/local/include/boost/log/attributes/value_visitation.hpp:182: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const'
/usr/local/include/boost/log/attributes/value_visitation.hpp:183: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::end() 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/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `boost::log::v2s_mt_posix::aux::light_function<bool (boost::log::v2s_mt_posix::attribute_value_set const&)>::impl<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::logical_and, boost::proto::argsns_::list2<boost::phoenix::actor<boost::log::v2s_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2s_mt_posix::expressions::has_attribute<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::logical_or, boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::logical_or, boost::proto::argsns_::list2<boost::phoenix::actor<boost::log::v2s_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2s_mt_posix::expressions::has_attribute<long> > >, boost::phoenix::actor<boost::log::v2s_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2s_mt_posix::expressions::has_attribute<unsigned long> > > >, 2l> >, boost::phoenix::actor<boost::log::v2s_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2s_mt_posix::expressions::has_attribute<std::chrono::duration<long, std::ratio<1l, 1000l> > > > > >, 2l> > >, 2l> > >::invoke_impl(void*, boost::log::v2s_mt_posix::attribute_value_set const&)':
/usr/local/include/boost/log/attributes/value_visitation.hpp:182: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const'
/usr/local/include/boost/log/attributes/value_visitation.hpp:183: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::end() 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&)'
collect2: error: ld returned 1 exit status
Makefile:1022: recipe for target 'console/bs' failed
make: *** [console/bs] Error 1

real	17m19.965s
user	40m32.287s
sys	2m36.447s

In my current directory there is install.sh and the build-libbitcoin-server directory. I have listed the build-libbitcoin-server directory contents below:


$ ls -la build-libbitcoin-server/
total 48
drwxr-xr-x 12 root       root       4096 Jan  7 14:13 .
drwxr-xr-x  3 myuser  myuser  4096 Jan  7 13:57 ..
drwxr-xr-x  7 root       root       4096 Jan  7 13:57 .git
drwxr-xr-x 12 root       root       4096 Jan  7 13:58 libbitcoin
drwxr-xr-x 11 root       root       4096 Jan  7 14:05 libbitcoin-blockchain
drwxr-xr-x 11 root       root       4096 Jan  7 14:03 libbitcoin-consensus
drwxr-xr-x 11 root       root       4096 Jan  7 14:03 libbitcoin-database
drwxr-xr-x 10 root       root       4096 Jan  7 14:07 libbitcoin-network
drwxr-xr-x 12 root       root       4096 Jan  7 14:09 libbitcoin-node
drwxr-xr-x 13 root       root       4096 Jan  7 14:12 libbitcoin-protocol
drwxr-xr-x 12 root       root       4096 Jan  7 14:13 libbitcoin-server
drwxr-xr-x 12 root       root       4096 Jan  7 13:57 secp256k1

Do you know why this failed? Just running into infinite problems :/

However, the install.sh script fails when trying to build boost v 1.62, very early on.

What's the error?

Bottom excerpt of ./install.sh output below:

/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/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::statsd_formatter(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&)':
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::statsd_formatter(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&)':
/usr/local/include/boost/log/attributes/attribute_value_set.hpp:372: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const'
/usr/local/include/boost/log/attributes/attribute_value_set.hpp:373: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::end() const'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::statsd_formatter(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&)':
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::statsd_formatter(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&)':
/usr/local/include/boost/log/attributes/value_visitation.hpp:182: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const'
/usr/local/include/boost/log/attributes/value_visitation.hpp:183: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::end() const'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::statsd_formatter(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&)':
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::statsd_formatter(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&)':
/usr/local/include/boost/log/attributes/attribute_value_set.hpp:372: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const'
/usr/local/include/boost/log/attributes/attribute_value_set.hpp:373: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::end() const'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::statsd_formatter(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&)':
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::statsd_formatter(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&)':
/usr/local/include/boost/log/attributes/attribute_value_set.hpp:372: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const'
/usr/local/include/boost/log/attributes/attribute_value_set.hpp:373: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::end() const'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::statsd_formatter(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&)':
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::statsd_formatter(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&)':
/usr/local/include/boost/log/attributes/attribute_value_set.hpp:372: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const'
/usr/local/include/boost/log/attributes/attribute_value_set.hpp:373: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::end() const'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::statsd_formatter(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&)':
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::statsd_formatter(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&)':
/usr/local/include/boost/log/attributes/attribute_value_set.hpp:372: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const'
/usr/local/include/boost/log/attributes/attribute_value_set.hpp:373: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::end() const'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::statsd_formatter(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&)':
/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/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::initialize_statsd(libbitcoin::log::rotable_file const&)':
/usr/local/include/boost/log/sinks/text_file_backend.hpp:417: undefined reference to `boost::log::v2s_mt_posix::sinks::text_file_backend::set_file_name_pattern_internal(boost::filesystem::path const&)'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::initialize_statsd(libbitcoin::log::rotable_file const&)':
/home/slyraccoon/Documents/Software/Final-Libbitcoin/build-libbitcoin-server/libbitcoin/src/log/statsd_sink.cpp:104: undefined reference to `boost::log::v2s_mt_posix::sinks::text_file_backend::set_rotation_size(unsigned long)'
/home/slyraccoon/Documents/Software/Final-Libbitcoin/build-libbitcoin-server/libbitcoin/src/log/statsd_sink.cpp:105: undefined reference to `boost::log::v2s_mt_posix::sinks::text_file_backend::set_file_collector(boost::shared_ptr<boost::log::v2s_mt_posix::sinks::file::collector> const&)'
/home/slyraccoon/Documents/Software/Final-Libbitcoin/build-libbitcoin-server/libbitcoin/src/log/statsd_sink.cpp:109: undefined reference to `boost::log::v2s_mt_posix::sinks::text_file_backend::auto_flush(bool)'
/home/slyraccoon/Documents/Software/Final-Libbitcoin/build-libbitcoin-server/libbitcoin/src/log/statsd_sink.cpp:115: undefined reference to `boost::log::v2s_mt_posix::core::get()'
/home/slyraccoon/Documents/Software/Final-Libbitcoin/build-libbitcoin-server/libbitcoin/src/log/statsd_sink.cpp:115: undefined reference to `boost::log::v2s_mt_posix::core::add_sink(boost::shared_ptr<boost::log::v2s_mt_posix::sinks::sink> const&)'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `libbitcoin::log::initialize_statsd(libbitcoin::threadpool&, libbitcoin::config::authority const&)':
/home/slyraccoon/Documents/Software/Final-Libbitcoin/build-libbitcoin-server/libbitcoin/src/log/statsd_sink.cpp:141: undefined reference to `boost::log::v2s_mt_posix::core::get()'
/home/slyraccoon/Documents/Software/Final-Libbitcoin/build-libbitcoin-server/libbitcoin/src/log/statsd_sink.cpp:141: undefined reference to `boost::log::v2s_mt_posix::core::add_sink(boost::shared_ptr<boost::log::v2s_mt_posix::sinks::sink> const&)'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `__static_initialization_and_destruction_0(int, int) [clone .constprop.417]':
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/include/boost/log/attributes/attribute_name.hpp:80: undefined reference to `boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)'
/usr/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `boost::log::v2s_mt_posix::visitation_result boost::log::v2s_mt_posix::value_visitor_invoker<long, boost::log::v2s_mt_posix::fallback_to_none>::operator()<boost::log::v2s_mt_posix::nop>(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&, boost::log::v2s_mt_posix::nop) const':
/usr/local/include/boost/log/attributes/value_visitation.hpp:182: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const'
/usr/local/include/boost/log/attributes/value_visitation.hpp:183: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::end() 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/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `boost::log::v2s_mt_posix::visitation_result boost::log::v2s_mt_posix::value_visitor_invoker<unsigned long, boost::log::v2s_mt_posix::fallback_to_none>::operator()<boost::log::v2s_mt_posix::nop>(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&, boost::log::v2s_mt_posix::nop) const':
/usr/local/include/boost/log/attributes/value_visitation.hpp:182: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const'
/usr/local/include/boost/log/attributes/value_visitation.hpp:183: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::end() 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/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `boost::log::v2s_mt_posix::visitation_result boost::log::v2s_mt_posix::value_visitor_invoker<std::chrono::duration<long, std::ratio<1l, 1000l> >, boost::log::v2s_mt_posix::fallback_to_none>::operator()<boost::log::v2s_mt_posix::nop>(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&, boost::log::v2s_mt_posix::nop) const':
/usr/local/include/boost/log/attributes/value_visitation.hpp:182: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const'
/usr/local/include/boost/log/attributes/value_visitation.hpp:183: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::end() 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/local/lib/libbitcoin.a(src_libbitcoin_la-statsd_sink.o): In function `boost::log::v2s_mt_posix::aux::light_function<bool (boost::log::v2s_mt_posix::attribute_value_set const&)>::impl<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::logical_and, boost::proto::argsns_::list2<boost::phoenix::actor<boost::log::v2s_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2s_mt_posix::expressions::has_attribute<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::logical_or, boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::logical_or, boost::proto::argsns_::list2<boost::phoenix::actor<boost::log::v2s_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2s_mt_posix::expressions::has_attribute<long> > >, boost::phoenix::actor<boost::log::v2s_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2s_mt_posix::expressions::has_attribute<unsigned long> > > >, 2l> >, boost::phoenix::actor<boost::log::v2s_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2s_mt_posix::expressions::has_attribute<std::chrono::duration<long, std::ratio<1l, 1000l> > > > > >, 2l> > >, 2l> > >::invoke_impl(void*, boost::log::v2s_mt_posix::attribute_value_set const&)':
/usr/local/include/boost/log/attributes/value_visitation.hpp:182: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const'
/usr/local/include/boost/log/attributes/value_visitation.hpp:183: undefined reference to `boost::log::v2s_mt_posix::attribute_value_set::end() 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&)'
collect2: error: ld returned 1 exit status
Makefile:1022: recipe for target 'console/bs' failed
make: *** [console/bs] Error 1

real	18m19.875s
user	45m32.140s
sys	2m47.730s

So you are running ./install.sh --prefix=/usr/local?

yes correct, i'm the only user on my laptop so I just used sudo

sudo ./install.sh --prefix=/usr/local --build-boost --disable-shared

Ok, so don't use sudo though, it can cause environmental issues that come up during the build. If you really want to run install.sh as root (not recommended), run it as root. The preferred way is to run it as a user and install to a prefix that isn't system level unless you really know what you're doing. I suggest for now trying it as your own user to a new prefix something like ./install.sh --prefix=/home/me/libbitcoin --build-boost --disable-shared for example. If you can get that working, feel free to move it elsewhere.

Hey @thecodefactory :) I was able to run ./install.sh --prefix=/home/me/libbitcoin --build-boost --disable-shared successfully, where I made sure to provide a non-root user. I wanted to ask why libbitcoin-client isn't included in the build? My main aim of using libbitcoin is to create a program which can connect to another node in my private altcoin test environment and view transactions. Am I correct to say that I need libbitcoin-client for this? And if that is the case, has it purposefully been set aside for user's to install separately?

Thanks

@tabbyreyez Glad to hear! libbitcoin-client is a client API for communicating with a libbitcoin-server, although it has access to the p2p network (in a somewhat limited form at the moment). If you want to run a p2p node that listens to other nodes, libbitcoin-node may be what you want (it's a full node). libbitcoin-server is a superset of libbitcoin-node and adds indexing of payments and query and subscription services, which might be overkill for what you need.

Thanks! I was having a look at the documentation for using libbitcoin-node, but the only guides I am seeing are outdated (from Libbitcoin Node). The guides from Aaron Jaramillo seem to only reference libbitcoin-client, which is why I asked my previous question.

It feels like you need to have very intricate knowledge of the source code to use this library. Can you provide some information on how to connect to other nodes using libbitcoin-node? I'm trying to piece things together by searching the source code and reading the Boost test classes, however I'm not having much luck :(

@tabbyreyez I recommend you join our Slack (https://bit.ly/2r3KVSm) or find us on IRC (freenode network, #libbitcoin). General questions/discussion over closed issues is not recommended.