I encountered errors when I tried to compile configtxgen in the path:'/d/Go/go/src/github.com/hyperledger/fabric (master)'
The message is shown below:
# github.com/hyperledger/fabric/cmd/configtxgen
D:\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\dell\AppData\Local\Temp\go-link-520369751\000004.o: In function `COVER_buildDictionary':
/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/cover.c:714: undefined reference to '__getreent'
/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/cover.c:714: undefined reference to '__getreent'
/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/cover.c:710: undefined reference to '__getreent'
/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/cover.c:710: undefined reference to '__getreent'
/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/cover.c:678: undefined reference to '__getreent'
C:\Users\dell\AppData\Local\Temp\go-link-520369751\000004.o:/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/cover.c:678: more undefined references to '__getreent' follow
C:\Users\dell\AppData\Local\Temp\go-link-520369751\000006.o: In function 'ss_mintrosort':
/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/divsufsort.c:509: undefined reference to '__assert_func'
/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/divsufsort.c:513: undefined reference to '__assert_func'
/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/divsufsort.c:512: undefined reference to '__assert_func'
/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/divsufsort.c:508: undefined reference to '__assert_func'
/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/divsufsort.c:517: undefined reference to '__assert_func'
C:\Users\dell\AppData\Local\Temp\go-link-520369751\000006.o:/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/divsufsort.c:516: more undefined references to '__assert_func' follow
C:\Users\dell\AppData\Local\Temp\go-link-520369751\000009.o: In function 'FASTCOVER_ctx_init':
/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/fastcover.c:324: undefined reference to '__getreent'
/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/fastcover.c:324: undefined reference to '__getreent'
/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/fastcover.c:311: undefined reference to '__getreent'
/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/fastcover.c:311: undefined reference to '__getreent'
/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/fastcover.c:318: undefined reference to '__getreent'
C:\Users\dell\AppData\Local\Temp\go-link-520369751\000009.o:/cygdrive/d/Go/go/src/github.com/hyperledger/fabric/vendor/github.com/DataDog/zstd/fastcover.c:318: more undefined references to '__getreent' follow
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:209: build/bin/configtxgen] Error 2
Some answers on google suggest that it may be due to the fact that the go version is 32-bit so that they are incompatible.But I literally installed the 64-bit go instead of 32-bit go and it is the latest version.Other answers I've found seem to be unrelated to my issue.
More information:
go version:
go version go1.14.4 windows/amd64
I use git bash on windows 10
go env:
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\dell\AppData\Local\go-build
set GOENV=C:\Users\dell\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=D:\Go\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=D:\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=D:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=D:\Go\src\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\dell\AppData\Local\Temp\go-build678055862=/tmp/go-build -gno-record-gcc-switches