首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用robotgo实现桌面自动化,在windows 10上构建失败

使用robotgo实现桌面自动化,在windows 10上构建失败
EN

Stack Overflow用户
提问于 2020-03-13 22:43:05
回答 1查看 461关注 0票数 0

在运行这个命令时,go get github.com/go-vgo/robotgo我得到了这个错误:

代码语言:javascript
运行
复制
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,我就开始得到这个异常:

代码语言:javascript
运行
复制
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.
EN

回答 1

Stack Overflow用户

发布于 2020-03-13 23:00:05

shirou/gopsutil Github repo中有一个封闭的issue #743 (和#835)来解决这个问题。

Citation with the fixture

我不认为它与Go版本有关,但是对于golang.org/x/sys/windows版本,你可以尝试用go get -u golang.org/x/sys/windows

更新它吗

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60672485

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档