-
Notifications
You must be signed in to change notification settings - Fork 1
Home
JH Y edited this page Mar 25, 2022
·
1 revision
- Install
MSYS2
- Open
MSYS2 MinGW x64
console - Install go
pacman -S mingw-w64-x86_64-go
- Install gcc
pacman -S mingw-w64-x86_64-gcc
- Export environment variables
export GOROOT=/mingw64/lib/go
export GOPATH=/mingw64
- 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
- Build
LD_LIBRARY_PATH="/mingw64/lib" CGO_CFLAGS="-I/mingw64/include -Bstatic" go build
- Download
libwinpthread-1.dll
and place it in the same directory as the executable file. (Download Guide)