Bitcoin: Bitcoin Core linking error

Bitcoin Core Error to connect Windows using WSL and Ubuntu 20.04

As a Bitcoin user, you are probably familiar with the importance of ensuring that your software is compatible with different operating systems and environments. However, when you build and install Bitcoin Core, especially from the source code, it can be a disappointing experience. In this article, we will study the linker error you are experiencing on Windows using WSL (Windows Linux Subsystem), working with Ubuntu 20.04.

The problem:

When trying to build Bitcoin output code V24.2 for Windows using WSL, you may encounter the following linker errors:

`bash

/USR/BIN/GCC

/USR/BIN/G ++: Undefined Symbol: __erno__

These error messages indicate that your compiler is not able to find an equivalent feature called __erno__ in the standard C.

Decision:

To solve this problem, you will need to make some adjustments to the construction process. Here is a step -by -step guide:

  • Install the GNU Compiler collection (GCC) :

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

`bash

SUDO APT update

Sudo apt install gcc-9

This version of GCC is compatible with Bitcoin Core.

  • Update cxx icpp flags :

Once you have installed GCC, you will need to update your C ++ and C code compiler flags. The correct flags are:

`bash

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

Flags CXX ICPP are used to clarify the C ++ code compiler. Replace gcc cg ++ if you use G ++.

  • Configuration and Construction

    :

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

`bash

CD/PATH/to/Bitcoin/SRC

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

Make -j $ (NPROC)

The flag `-enable-openssl = 1 allows the OpenSSL library for construction with cryptography.

  • Complete the installer :

After building Bitcoin Core you will need to start the installer:

`bash

./installer--build --- Preinstall --- No-Synctool --- Config /usr/local/etc/bitcoin.conf

The -config option indicates a configuration file that contains the settings for your compilation. The road is relative to the current directory.

  • Check :

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

`bash

Bitcoind

This should show information about the version showing that the Bitcoin Core is built with the right flags.

Following these steps, you must be able to resolve the linker error and successfully build Bitcoin output code V24.2 for Windows using WSL working with Ubuntu 20.04.

Leave a Reply

Your email address will not be published. Required fields are marked *