go 问题记录

go 问题记录

/usr/lib/go-1.10/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/tmp/go-link-008006128/000026.o: In function _cgo_05dc84caff82_Cfunc_sysconf': /tmp/go-build/cgo-gcc-prolog:32: multiple definition of_cgo_05dc84caff82_Cfunc_sysconf’
/tmp/go-link-008006128/000024.o:/tmp/go-build/cgo-gcc-prolog:32: first defined here
collect2: error: ld returned 1 exit status

解决办法:

linux: export CGO_ENABLED=0
windows : cmd: set CGO_ENABLED=0
windows : powershell:$env:CGO_ENABLED=0

https://github.com/golang/go/issues/15038

panic: /debug/requests is already registered. You may have two independent copies of golang.org/x/net/trace in your binary, trying to maintain separate state. This may involve a vendored copy of golang.org/x/net/trace.

解决办法:olang.org/x/net/trace这个重复了,删除所有的引用的或者系统的olang.org/x/net/的trace 只保留一个即可。注意要查看项目引用的项目是否也有

exec: “gcc”: executable file not found in %PATH%

解决办法:
下载 mingw ,地址: https://sourceforge.net/projects/mingw-w64/,
安装选择x86_x64
设置环境变量:C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin(安装路径)

你可能感兴趣的:(go)