:: [Libbitcoin] linker errors with lib…
Top Page
Delete this message
Reply to this message
Author: Amir Taaki
Date:  
To: libbitcoin
Subject: [Libbitcoin] linker errors with libbitcoin and pkg-config (linux)
I tried to track down in the git history but it's difficult and time
consuming. Any ideas why the pkg-config linking with libbitcoin no
longer works?

$ cat orgwork.cpp
#include <bitcoin/bitcoin.hpp>

bc::hash_number sum_difficulty()
{
    bc::hash_number total_work = 0;
    return total_work;
}


int main()
{
    bc::hash_number orphan_work = 0;
    orphan_work += bc::block_work(486604799);
    bc::hash_number main_work = sum_difficulty();
    if (orphan_work <= main_work)
        bc::log_debug() << "Fail";
    else
        bc::log_debug() << "Pass";
    return 0;
}


$ g++ orgwork.cpp $(pkg-config --cflags --libs libbitcoin)
/home/rescue/usr/lib/libbitcoin.so: undefined reference to `pthread_create'
/home/rescue/usr/lib/libbitcoin.so: undefined reference to `pthread_detach'
/home/rescue/usr/lib/libbitcoin.so: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status