The results of go env are below. If I'm reading this correctly, CC=gcc. set GO111MODULE=auto set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\Owner\AppData\Local\go-build set GOENV=C:\Users\Owner\AppData\Roaming\go\env set GOEXE=.exe set GOEXPERIMENT= set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOINSECURE= set GOMODCACHE=C:\Users\Owner\go\pkg\mod set GONOPROXY= set GONOSUMDB= set GOOS=windows set GOPATH=C:\Users\Owner\go set GOPRIVATE= set GOPROXY=https://proxy.golang.org,direct set GOROOT=C:\Program Files\Go set GOSUMDB=sum.golang.org set GOTMPDIR= set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64 set GOVCS= set GOVERSION=go1.17.2 set GCCGO=gccgo set AR=ar set CC=gcc set CXX=g++ set CGO_ENABLED=1 set GOMOD=C:\Users\Owner\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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\Owner\AppData\Local\Temp\go-build4162893276=/tmp/go-build -gno-record-gcc-switches
On Thursday, November 4, 2021 at 6:20:10 PM UTC-4 Ian Lance Taylor wrote: > On Wed, Nov 3, 2021 at 5:40 PM Robert Solomon <drro...@gmail.com> wrote: > > > > I'm setting up a new Windows10 computer. I installed Go 1.17.2 and > mingw64 for cgo. When I tried to compile a project that uses cgo, I got > this error: > > > > cgo: exec gcc: gcc resolves to executable relative to current directory > (.\\msys64\mingw64\bin\gcc.exe) > > > > This is a program that compiles fine on my older win10 computer. > > > > I don't think this matters, but I'm compiling a program of mine that > uses fyne, which uses cgo. > > This suggests that the CC environment variable is set to > ".\\msys64\mingw64\bin\gcc.exe" with a leading dot. That is not an > absolute path. That is not permitted for the reasons given at > https://golang.org/issue/43783. > > Ian > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e60e5b03-92d4-4f01-a516-1fca7e2905bdn%40googlegroups.com.