NOTE: This tutorial is made fora PoC to create the BlackHalo version of the blackcoind.exe file. This version uses Berkeley DB version 6.x, which is not compatible with the default Blackcoin Lore and Blackcoin Legacy wallets (BDB 5.3.28 is used). You WILL corrupt your wallet if you exchange them between the different versions. Be careful with your funds!

I use Ubuntu 18.04 for this article, I cannot confirm it works on other Ubuntu versions or Linux distro.

First we need the some packages installed:

sudo apt install autoconf automake autopoint bash bison bzip2 p7zip-full cmake flex gettext git g++ gperf intltool libffi-dev libtool libltdl-dev libssl-dev libxml-parser-perl make openssl patch perl pkg-config python ruby scons sed unzip wget xz-utils p7zip-rar ri ruby-dev bundler libmpfr-dev lzip libtool-bin libgdk-pixbuf2.0-dev

for cross-compile :

sudo apt install g++-multilib libc6-dev-i386

Clone some repo's from Github/Gitlab:

We need the blackcoin-lore watchonly branch from here: https://gitlab.com/blackcoin/blackcoin-lore/tree/watchonly

and we need the mxe master branch from here: https://github.com/mxe/mxe

I am assuming that you know how to clone this into directory on you local drive. I use Gitkraken for this. I clone everything into a directory called /home/michel/legacy/

Blackcoin Lore - watchonly branch:

Gitkraken - Blackcoin Lore

MXE build environment - master:

Gitkraken - MXE

From an explorer view you end up with 2 folders:

Folder view

Because mxe uses openssl 1.1.x by default, and Blackcoin doesn't compile against that version. We need to use version 1.0.x (at this moment 1.0.2q)

copy the files from the mxe/plugins/examples/openssl1.0/ directory:

Openssl1.0 files

to the the directory mxe/src/ :

openssl1.0 in src/ directory

As you can see we now have 2 versions. This will complicate things a bit, but don't worry. We just need to double check the version, before compiling.

Compiling first mxe build packages:

First we will upgrade 2 packages to the current version, openssl1.0 and miniupnpc, by running the following commands

~legacy/mxe$make update-package-openssl1.0

~legacy/mxe$make update-package-miniupnpc

then we compile the following packages with the make command. (-j2 is the number of CPU cores you wish to use)

~/legacy/mxe $make MXE_PLUGIN_DIRS=plugins/gcc8 boost miniupnpc -j2

this will start the build process. Takes a while and should look something similar to this:

mxe compile

then the last batch:

~/legacy/mxe$make MXE_PLUGIN_DIRS=plugins/gcc8 openssl1.0 db zlib libpng -j2

this time it goes a lot faster. You can also add the packages to the first make command. But I like to split up some things. result:

make sure you use OPENSSL1.0

Now we can go the blackcoin-lore directory and compile the executable. We are going to use the file makefile.mxe-linux-mingw for that. Check it and adapt it, if you use different directories. It is located in the src/ directory

/legacy/mxe in my case, yours can be different

compile blackoind.exe:

now the easy part. Run the following command from within the src/ directory

~/legacy/blackcoin-lore/src$ make -f makefile.mxe-linux-mingw -j2

This will take a few minutes and it will create the 32-bit version of blackcoind.exe for windows. you should see something similar to this:

make sure no warnings/errors appear

the executable is created inside the src/ directory. Copy it out of the build directory and place it somewhere safe. And make sure you cleanup after you are done with the following command:

~/legacy/blackcoin-lore/src$ make -f makefile.mxe-linux-mingw clean

I always do a "git clean -dxf" from the blackcoin-lore root directory to reset the complete tree back to default.

Testing the binary on BlackHalo for Windows:

Shutdown BlackHalo and go to the root directory inside the BlackHalo installation and rename the current blackcoind.exe to something like blackcoind.exe.120. Place the new blackcoind.exe file inside root directory and start BlackHalo again. At the time of writing the current Blackcoin Lore versions is v1.2.5.2 and therefore I see the following in the debug.log file, which is located inside the data\ directory

well done! and have fun with BlackHalo!

Kudos to Lateminer and David Zimbeck for helping me out! and this post on Bitcointalk for guidance