bitcoin compile (.undefined reference to **') I'm getting error after make command like,

undefined reference to `BlockAssembler::BlockAssembler(CChainParams const&amp;)'

and in last 

Makefile:774: recipe for target 'all-recursive' failed

make: **[all-recursive] Error 1

I have followed all steps given here:-

https://www.toshblocks.com/bitcoin/compile-bitcoin-source-code-ubuntu-16-04-lts/

Output :-

 Making all in src
    make[1]: Entering directory '/home/khushbu/bitcoin/src'
    make[2]: Entering directory '/home/khushbu/bitcoin/src'
    make[3]: Entering directory '/home/khushbu/bitcoin'
    make[3]: Leaving directory '/home/khushbu/bitcoin'
      CXXLD    bitcoind
    libbitcoin_server.a(libbitcoin_server_a-mining.o): In function `generateBlocks(std::shared_ptr&lt;CReserveScript&gt;, int, unsigned long, bool)':
    /home/khushbu/bitcoin/src/rpc/mining.cpp:122: undefined reference to `BlockAssembler::BlockAssembler(CChainParams const&amp;)'
    /home/khushbu/bitcoin/src/rpc/mining.cpp:122: undefined reference to `BlockAssembler::CreateNewBlock(CScript const&amp;, bool)'
    /home/khushbu/bitcoin/src/rpc/mining.cpp:128: undefined reference to `IncrementExtraNonce(CBlock*, CBlockIndex const*, unsigned int&amp;)'
    libbitcoin_server.a(libbitcoin_server_a-mining.o): In function `getmininginfo(JSONRPCRequest const&amp;)':
    /home/khushbu/bitcoin/src/rpc/mining.cpp:216: undefined reference to `nLastBlockWeight'
    /home/khushbu/bitcoin/src/rpc/mining.cpp:217: undefined reference to `nLastBlockTx'
    libbitcoin_server.a(libbitcoin_server_a-mining.o): In function `getblocktemplate(JSONRPCRequest const&amp;)':
    /home/khushbu/bitcoin/src/rpc/mining.cpp:521: undefined reference to `BlockAssembler::BlockAssembler(CChainParams const&amp;)'
    /home/khushbu/bitcoin/src/rpc/mining.cpp:521: undefined reference to `BlockAssembler::CreateNewBlock(CScript const&amp;, bool)'
    /home/khushbu/bitcoin/src/rpc/mining.cpp:533: undefined reference to `UpdateTime(CBlockHeader*, Consensus::Params const&amp;, CBlockIndex const*)'
    collect2: error: ld returned 1 exit status
    Makefile:3888: recipe for target 'bitcoind' failed
    make[2]: *** [bitcoind] Error 1
    make[2]: Leaving directory '/home/khushbu/bitcoin/src'
    Makefile:10190: recipe for target 'all-recursive' failed
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory '/home/khushbu/bitcoin/src'
    Makefile:774: recipe for target 'all-recursive' failed
    make: *** [all-recursive] Error 1


How to solve this error and compile bitcoin source code successfully?
It looks like you're having linker errors, possibly due to the way you're installing and configuring the BerkeleyDB. It would help to post the output of the ./configure command. Bitcoin-core recommends installing it using the Bitcoin PPA:

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev


Then you don't have to run ./configure with the LDFLAGS andCPPFLAGS for BerkeleyDB.

I would recommend following the UNIX build instructions in the repository. First download the source code for the release you want from the repository releases.

$ tar xvzf v0.17.0.tar.gz &amp;&amp; cd v0.17.0


Then follow the instructions in the link above.