I try to build Bitcoin Core on my Ubuntu 23.10 machine using the “Build Unix” documentation page but it fails with undefined reference to evhttp_uridecode
.
Here are the details:
I started by cloning the repo locally and using the v26.0 tag:
git clone [email protected]:bitcoin/bitcoin.git
cd bitcoin
git checkout v26.0
Then installed the necessary packages:
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential libtool autotools-dev automake pkg-config bsdmainutils python3
sudo apt install -y libevent-dev libboost-dev
sudo apt install -y libzmq3-dev systemtap-sdt-dev
I’m not interested in building the wallet, but just the P2P protocol, so I skipped the other installs.
Then starts the build phase:
./autogen.sh
./configure --disable-bench --disable-fuzz-binary --enable-debug --without-gui \
--enable-suppress-external-warnings --disable-wallet
make -j 4
This last make
commands returns an error after some time:
...
CXXLD libbitcoinconsensus.la
AR libbitcoin_util.a
CXXLD bitcoin-cli
CXXLD bitcoin-tx
CXXLD bitcoin-util
/usr/bin/ld: libbitcoin_common.a(libbitcoin_common_a-url.o): in function `urlDecode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/hassen/Workspace/OpenSource/bitcoin/src/common/url.cpp:15:(.text+0x61): undefined reference to `evhttp_uridecode'
/usr/bin/ld: libbitcoin_common.a(libbitcoin_common_a-url.o): in function `urlDecode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/hassen/Workspace/OpenSource/bitcoin/src/common/url.cpp:15:(.text+0x61): undefined reference to `evhttp_uridecode'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:7407: bitcoin-util] Error 1
make[2]: *** Waiting for unfinished jobs....
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:7403: bitcoin-tx] Error 1
make[2]: Leaving directory '/home/hassen/Workspace/OpenSource/bitcoin/src'
make[1]: *** [Makefile:20138: all-recursive] Error 1
make[1]: Leaving directory '/home/hassen/Workspace/OpenSource/bitcoin/src'
make: *** [Makefile:814: all-recursive] Error 1
It looks like the issue is that evhttp_uridecode
is not found. However I’m pretty sure I installed all the necessary packages.
If this can help, running uname -a
on my machine returns:
Linux XPS-machine 6.5.0-14-generic #14-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 14 14:59:49 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Thanks for your help.