You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What operating system and processor architecture are you using (go env)?
Windows 10
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\homepc\AppData\Local\go-build
set GOENV=C:\Users\homepc\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\homepc\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
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\homepc\AppData\Local\Temp\go-build692364802=/tmp/go-build -gno-record-gcc-switches
What did you do?
Build in windows 10 failed
C:\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\homepc\AppData\Local\Temp\go-link-980381163\000004.o: In function `COVER_buildDictionary':
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/cover.c:678: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/cover.c:678: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/cover.c:714: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/cover.c:714: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/cover.c:710: undefined reference to `__getreent'
C:\Users\homepc\AppData\Local\Temp\go-link-980381163\000004.o:/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/cover.c:710: more undefined references to `__getreent' follow
C:\Users\homepc\AppData\Local\Temp\go-link-980381163\000006.o: In function `ss_mintrosort':
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/divsufsort.c:495: undefined reference to `__assert_func'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/divsufsort.c:494: undefined reference to `__assert_func'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/divsufsort.c:509: undefined reference to `__assert_func'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/divsufsort.c:499: undefined reference to `__assert_func'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/divsufsort.c:498: undefined reference to `__assert_func'
C:\Users\homepc\AppData\Local\Temp\go-link-980381163\000006.o:/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/divsufsort.c:513: more undefined references to `__assert_func' follow
C:\Users\homepc\AppData\Local\Temp\go-link-980381163\000009.o: In function `FASTCOVER_ctx_init':
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/fastcover.c:311: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/fastcover.c:311: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/fastcover.c:318: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/fastcover.c:318: undefined reference to `__getreent'
/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/fastcover.c:324: undefined reference to `__getreent'
C:\Users\homepc\AppData\Local\Temp\go-link-980381163\000009.o:/cygdrive/c/Users/homepc/go/pkg/mod/github.com/!data!dog/zstd@v1.4.4/fastcover.c:324: more undefined references to `__getreent' follow
collect2.exe: error: ld returned 1 exit status
What did you expect to see?
Should build successfully
What did you see instead?
I initially got gcc not found error, so I installed TDM-GCC-64 and add path C:\TDM-GCC-64\bin, then, I got above error
Basic example from cgo (https://golang.org/cmd/cgo/, where C code may call function pointers received ...) compiles and runs successfully, so I don't think there are some problems with my local installation.
The text was updated successfully, but these errors were encountered:
Hi @flerka
Thanks for reporting!
I don't have a windows env on hand but it looks like you might not be able to correctly link the standard library (i.e: __assert_func should be given by assert package)
From looking around, it looks like most of the time it's trying to link against the 32bits library, would you have a way to check that ?
The basic example from cgo works because it doesn't link any external code, just compile everything in the same file
From looking around, it looks like most of the time it's trying to link against the 32bits library, would you have a way to check that ?
You were totally right about that. Before installing 64 version of go, 32 version was installed accidently. And even after it (32bit go) was uninstalled and 64bit go installed - some folders were not deleted from 32bit env. Some packages etc.
So after reading your message I uninstalled go and manually removed all go-related files from all go env folders. I again installed 64bit Go and problem was fixed.
What version of Go are you using (
go version
)?go version go1.13.6 windows/amd64
What operating system and processor architecture are you using (
go env
)?Windows 10
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\homepc\AppData\Local\go-build
set GOENV=C:\Users\homepc\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\homepc\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
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\homepc\AppData\Local\Temp\go-build692364802=/tmp/go-build -gno-record-gcc-switches
What did you do?
Build in windows 10 failed
What did you expect to see?
Should build successfully
What did you see instead?
I initially got gcc not found error, so I installed TDM-GCC-64 and add path C:\TDM-GCC-64\bin, then, I got above error
I think it's related to this issue #63
Basic example from cgo (https://golang.org/cmd/cgo/, where
C code may call function pointers received ...
) compiles and runs successfully, so I don't think there are some problems with my local installation.The text was updated successfully, but these errors were encountered: