运行此命令时,请访问github.com/go-vgo/robotgo我得到这个错误:
C:Users<removed>gosrcgithub.comshirougopsutilprocessprocess_windows.go:174:13: undefined: windows.EnumProcesses
C:Users<removed>gosrcgithub.comshirougopsutilprocessprocess_windows.go:212:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:Users<removed>gosrcgithub.comshirougopsutilprocessprocess_windows.go:216:12: undefined: windows.ERROR_INVALID_PARAMETER
C:Users<removed>gosrcgithub.comshirougopsutilprocessprocess_windows.go:281:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:Users<removed>gosrcgithub.comshirougopsutilprocessprocess_windows.go:384:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:Users<removed>gosrcgithub.comshirougopsutilprocessprocess_windows.go:448:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:Users<removed>gosrcgithub.comshirougopsutilprocessprocess_windows.go:494:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:Users<removed>gosrcgithub.comshirougopsutilprocessprocess_windows.go:798:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:Users<removed>gosrcgithub.comshirougopsutilprocessprocess_windows.go:813:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:Users<removed>gosrcgithub.comshirougopsutilprocessprocess_windows.go:847:32: undefined: windows.PROCESS_QUERY_LIMITED_INFORMATION
C:Users<removed>gosrcgithub.comshirougopsutilprocessprocess_windows.go:847:32: too many errors
Go版本为1.9
一旦我更新了sys/windows,我就开始得到这个异常:
D:golangprj4src>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>gosrcgithub.comgo-vgorobotgorobotgo.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.
shirou/gopsutil Github repo中有一个已关闭的问题#743(和#835(。
夹具引文:
我不认为它与Go版本有关,但与
golang.org/x/sys/windows
版本,你能试着用go get -u golang.org/x/sys/windows
更新吗?