undefined: syscall.SIGUSR1,exec: "gcc": executable file not found in %PATH%

又今天换了电脑,之前的项目运行报错

# github.com/fvbock/endless
vendor\github.com\fvbock\endless\endless.g64:3: undefined: syscall.SIGUSR1
vendor\github.com\fvbock\endless\endless.g65:3: undefined: syscall.SIGUSR2
vendor\github.com\fvbock\endless\endless.g68:3: undefined: syscall.SIGTSTP
vendor\github.com\fvbock\endless\endless.g111:5: undefined: syscall.SIGUSR1
vendor\github.com\fvbock\endless\endless.g112:5: undefined: syscall.SIGUSR2
vendor\github.com\fvbock\endless\endless.g115:5: undefined: syscall.SIGTSTP
vendor\github.com\fvbock\endless\endless.g119:5: undefined: syscall.SIGUSR1
vendor\github.com\fvbock\endless\endless.g120:5: undefined: syscall.SIGUSR2
vendor\github.com\fvbock\endless\endless.g123:5: undefined: syscall.SIGTSTP
vendor\github.com\fvbock\endless\endless.g224:3: undefined: syscall.Kill
vendor\github.com\fvbock\endless\endless.g224:3: too many errors

晚上百度白嫖了一波改了一下

先找到  syscall/types_windows.go

如果是goland的编辑器 库直接  ctrl + shift + n 输入  syscall/types_windows.go 直接定位找到

或者就点击编辑器报错高亮一步步点过去

修改位置

/** 兼容windows start */
16: "SIGUSR1",
17: "SIGUSR2",
18: "SIGTSTP",
/** 兼容windows end */



/** 兼容windows start */
func Kill(...interface{}) {
return;
}

const (
SIGUSR1 = Signal(0x10)
SIGUSR2 = Signal(0x11)
SIGTSTP = Signal(0x12)
)
/** 兼容windows end */

然后运行程序

这个时候又又又又报错了

exec: "gcc": executable file not found in %PATH%

这里下载一下 传送门  解压到文件夹里 加个 path
cmd 运行   gcc -v  有返回就正常可以用了








伍先生
  • 职业: 程序员,产品
  • 码龄: 6.0
  • 技能: PHP Go 前端
  • 微信: JwCode
  • 公众号/小程序: 渐悟分享