Skip to content
JH Y edited this page Mar 25, 2022 · 1 revision

Windows build

  1. Install MSYS2
  2. Open MSYS2 MinGW x64 console
  3. Install go
pacman -S mingw-w64-x86_64-go
  1. Install gcc
pacman -S mingw-w64-x86_64-gcc
  1. Export environment variables
export GOROOT=/mingw64/lib/go
export GOPATH=/mingw64
  1. Update cgo LDFLAGS settings in counter/counter.go
// #cgo LDFLAGS: -l:libgmpxx.dll.a -l:libmpfr.a -l:libgmp.a -l:libgmp.dll.a -l:libgmpxx.a 
  1. Build
LD_LIBRARY_PATH="/mingw64/lib" CGO_CFLAGS="-I/mingw64/include -Bstatic" go build
  1. Download libwinpthread-1.dll and place it in the same directory as the executable file. (Download Guide)
Clone this wiki locally