Skip to content

Build Windows

Harshit Mehndiratta edited this page Oct 30, 2023 · 16 revisions

How to build on Windows

Windows 64bit (tested with Windows 11)

  1. Installing msys2 from here.
  2. Open MSYS2 MINGW64 shell. The MINGW64 shell window should look similar to the screenshot below.

mingw64 shell

  1. Install the following libraries:
pacman -S base-devel git gcc make
  1. Install clang, go for mingw64 and unzip
pacman -S  mingw-w64-x86_64-clang mingw-w64-x86_64-go unzip
  1. Set environment variables
export GOROOT=/mingw64/lib/go
export GOPATH=/mingw64
export PATH=$PATH:$GOROOT/bin

# use clang as a default compiler for CGO
go env -w "CC=/mingw64/bin/clang.exe"
  1. Clone zboxcli
git clone https://github.com/0chain/zboxcli.git
  1. Navigate to zboxcli and run the following command:
cd zboxcli
make install
  1. Download necessary dll files as zip from here. Unzip and copy dll's to the following path C:\msys64\home<your_windows_username>\zboxcli (This directory is created when MSYS2 is installed and zboxcli is cloned under MSYS2 MINGW64 shell).
wget https://github.com/0chain/zboxcli/files/11840033/windows.dll.s.zip
unzip windows.dll.s.zip
  1. Now rename zbox file under zboxcli directory(C:\msys64\home<your_windows_username>\zboxcli) to zbox.exe. See the screenshot below for reference:

zbox file rename

  1. Launch Windows PowerShell and navigate to the zboxcli directory (typically located at C:\msys64\home<your_windows_username>\zboxcli). Execute the ./zbox command to display the comprehensive help list. Refer to the screenshot below:

powershell

Clone this wiki locally