在运行这个命令时,go get github.com/go-vgo/robotgo我得到了这个错误:
C:\Users\<removed>\go\src\github.com\shirou\gopsutil\process\process_windows.go:174:13: undefined: windows.EnumProcesses
C:\Users\<removed>\go\src\github.com\shirou\gopsutil\process\process_windows.go:212:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:\Users\<removed>\go\src\github.com\shirou\gopsutil\process\process_windows.go:216:12: undefined: windows.ERROR_INVALID_PARAMETER
C:\Users\<removed>\go\src\github.com\shirou\gopsutil\process\process_windows.go:281:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:\Users\<removed>\go\src\github.com\shirou\gopsutil\process\process_windows.go:384:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:\Users\<removed>\go\src\github.com\shirou\gopsutil\process\process_windows.go:448:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:\Users\<removed>\go\src\github.com\shirou\gopsutil\process\process_windows.go:494:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:\Users\<removed>\go\src\github.com\shirou\gopsutil\process\process_windows.go:798:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:\Users\<removed>\go\src\github.com\shirou\gopsutil\process\process_windows.go:813:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:\Users\<removed>\go\src\github.com\shirou\gopsutil\process\process_windows.go:847:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:\Users\<removed>\go\src\github.com\shirou\gopsutil\process\process_windows.go:847:32: too many errors
Go版本为1.9
一旦我更新了sys/windows,我就开始得到这个异常:
D:\golang\prj4\src>go build main.go
# github.com/go-vgo/robotgo
In file included from ./bitmap/../base/str_io_c.h:2,
from ./bitmap/goBitmap.h:17,
from C:\Users\<removed>\go\src\github.com\go-vgo\robotgo\robotgo.go:45:
./bitmap/../base/zlib_util_c.h:2:10: fatal error: zlib.h: No such file or directory
2 | #include <zlib.h>
| ^~~~~~~~
compilation terminated.
发布于 2020-03-13 23:00:05
在shirou/gopsutil Github repo中有一个封闭的issue #743 (和#835)来解决这个问题。
我不认为它与Go版本有关,但是对于
golang.org/x/sys/windows
版本,你可以尝试用go get -u golang.org/x/sys/windows
更新它吗
https://stackoverflow.com/questions/60672485
复制相似问题