1

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  
david_k
  • 5,843
  • 2
  • 9
  • 16
  • I am not sure if it will solve your issue, but can you try with `go version go1.12`, as it is meant for Hyperledger Fabric as suggested in the official documentation here: https://hyperledger-fabric.readthedocs.io/en/release-1.4/prereqs.html#go-programming-language – Chintan Rajvir Jul 11 '20 at 06:51
  • 1
    It seems like you're right!Thank you so much! – AuroraLilith Jul 12 '20 at 12:02
  • I'm sorry to bother you but...I've just encountered another issue,and it's really confusing.I just use the ./network_setup.sh up order yet it showed me the information:'ERROR: 1.14.4 is required to build Fabric and you are using 1.12.17. Please update go.'I'm so confused.I tried the latest go version,yet i can't perform the order'make configtxgen'.Now it tells me that my go version is too old...So can anyone tell me what i am supposed to do?I'd appreciate it. – AuroraLilith Jul 12 '20 at 15:01

0 Answers0