尝试在GO中安装StackImpact库时出现错误。

huangapple go评论102阅读模式
英文:

Error when trying to install StackImpact library in GO

问题

我在尝试在GO中安装StackImpact时遇到以下错误。有人知道如何修复吗?

谢谢..

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
C:\Users\leonardo>go get github.com/stackimpact/stackimpact-go
# github.com/stackimpact/stackimpact-go/internal
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:96: undefined: syscall.Getrusage
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:102: rusage.Utime undefined (type *syscall.Rusage has no field or method Utime)
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:103: rusage.Utime undefined (type *syscall.Rusage has no field or method Utime)
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:104: rusage.Stime undefined (type *syscall.Rusage has no field or method Stime)
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:105: rusage.Stime undefined (type *syscall.Rusage has no field or method Stime)
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:112: undefined: syscall.Getrusage
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:117: rusage.Maxrss undefined (type *syscall.Rusage has no field or method Maxrs
s)
C:\Users\leonardo>
英文:

I'm getting the below errors when trying to install StackImpact in GO. Does anyone know how to fix it?

Tnx..

Microsoft Windows [versão 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Todos os direitos reservados.
C:\Users\leonardo>go get github.com/stackimpact/stackimpact-go
# github.com/stackimpact/stackimpact-go/internal
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:96: undefined: syscall.Getrusage
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:102: rusage.Utime undefined (type *syscall.Rusage has no field or method Utime)
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:103: rusage.Utime undefined (type *syscall.Rusage has no field or method Utime)
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:104: rusage.Stime undefined (type *syscall.Rusage has no field or method Stime)
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:105: rusage.Stime undefined (type *syscall.Rusage has no field or method Stime)
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:112: undefined: syscall.Getrusage
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:117: rusage.Maxrss undefined (type *syscall.Rusage has no field or method Maxrs
s)
C:\Users\leonardo>

答案1

得分: 1

你正在尝试在Windows上编译适用于Linux的代码。syscall.Getrusage是一个Linux系统调用。

https://golang.org/src/syscall/zsyscall_linux_amd64.go?s=13296:13347#L546

英文:

You're trying to compile a code that's meant for linux in Windows. syscall.Getrusage is a linux system call.

https://golang.org/src/syscall/zsyscall_linux_amd64.go?s=13296:13347#L546

答案2

得分: 0

Windows支持的起始版本是1.2.2

英文:

Windows is supported starting from agent version 1.2.2.

huangapple
  • 本文由 发表于 2016年12月31日 07:34:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/41404011.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定