Compile XDAG wallet for Windows

FSOL
4 min readOct 18, 2022

--

Tutorial “from stratch” for clean Windows install.

If you want to obtain this, follow instructions above.

1°/ Install and update MSYS2 environment

  • Run installation (follow guide as written on msys2’s website)
Select default path for install

When this window appear, you’re ready to go :

Now install gcc (GNU Compiler Collection) :

pacman -S mingw-w64-x86_64-gcc
gcc now install

Note : Follow upgrade process on https://www.msys2.org/docs/updating/ .

In details:

pacman -Suy
Confirm to close

After closing, repeat again :

pacman -Suy
Always confirm

In some case, AV program can rise up :

Create an exception if necessary to complete install

2°/ Cloning from GitHub

We need to install ‘git’ for msys2 :

pacman -S git
Always conf
git clone https://github.com/XDagger/goXdagWallet

Same as above, AV program can rise up :

Create an exception if necessary

As you can see, we retreive goXdagWallet sources :

3°/ Build usefull lib

In details, enter following commands :

pacman -S autoconf perl automake-wrapper libtool make
cd
git clone https://github.com/bitcoin-core/secp256k1
cd secp256k1
./autogen.sh
./configure
make
make install
This is what you’ll obtain (check with ls -l)

4°/ Build wallet’s /clib part

We’ll have to install some stuff :

cd
pacman -S openssl-devel cmake

Now we build :

cd goXdagWallet/clib
cmake .
make

This is the result you should get :

Rename file you obtain :

mv libxdag_runtime_MINGW64_NT-*.a libxdag_runtime_Windows.a

The end of file name could change. It’s depend of your Windows release. By example for Windows 11, could finish by ‘NT-10.0–22000.a’ . It’s not a matter !

So now you should obtain this :

5°/ Build wallet’s /wallet part

Let’s install go language :

cd
pacman -S mingw-w64-x86_64-go

Setup some vars :

export GOROOT=/mingw64/lib/go
export GOPATH=/mingw64

Install good text-editor for code. I recommend VS CODE. Get it here : https://code.visualstudio.com/

Launch VSCODE, and open C:\msys64\home\<username>\goXdagWallet\wallet\components\wallet_cgo.gofile :

On 3rd CGO line, remplace -L/usr/lib :

By -LC:/msys64/usr/lib :

Now the final touch :

cd
cd goXdagWallet/wallet
go mod tidy
set CGO_ENABLED=1
go build -ldflags -H=windowsgui

And the result is :

You did it ! BRAVO !

Just copy somes .DLL in wallet folder :

cp /mingw64/bin/libwinpthread-1.dll .
cp /usr/bin/msys-crypto-1.1.dll .
cp /usr/bin/msys-2.0.dll .
cp /usr/bin/msys-z.dll .

Now let’s verify if it’s working.

Open Windows Explorer C:\msys64\home\<username>\goXdagWallet\wallet\and launch ‘goXdagWallet.exe’ :

Your own wallet’s compilation

Extra notes

You can use official golang package outside msys to compile wallet.

In this case, you don’h have :

  • to do first step of 5°) phase, and do the rest inside Windows command box.
  • to copy msys*.dll files

Make some tests.

--

--