robotgo
robotgo copied to clipboard
build failing on windows 386
- Robotgo version (or commit ref): v1.0.0-beta5.3
- Go version: go version go1.19.1 windows/amd64
- Gcc version: gcc.exe (x86_64-win32-sjlj-rev0, Built by MinGW-W64 project) 8.1.0
- Operating system and bit: win10 64bit
- Resolution:
- Can you reproduce the bug at Examples:
- [x] Yes (provide example code)
- [ ] No
- [ ] Not relevant
- Provide example code:
package main
import (
"fmt"
"github.com/go-vgo/robotgo"
)
func main() {
color := robotgo.GetPixelColor(67, 344)
fmt.Println("color:", color)
}
- Log gist: go run main.go ....\pkg\mod\github.com\go-vgo\[email protected]\img.go:92:40: undefined: Bitmap ....\pkg\mod\github.com\go-vgo\[email protected]\img.go:107:38: undefined: Bitmap ....\pkg\mod\github.com\go-vgo\[email protected]\img.go:137:20: undefined: Bitmap ....\pkg\mod\github.com\go-vgo\[email protected]\robotgo_mac_win.go:23:9: undefined: internalGetBounds ....\pkg\mod\github.com\go-vgo\[email protected]\robotgo_mac_win.go:33:9: undefined: internalGetClient ....\pkg\mod\github.com\go-vgo\[email protected]\robotgo_mac_win.go:42:12: undefined: cgetTitle ....\pkg\mod\github.com\go-vgo\[email protected]\robotgo_mac_win.go:60:2: undefined: internalActive ....\pkg\mod\github.com\go-vgo\[email protected]\robotgo_mac_win.go:66:9: undefined: getNumDisplays ....\pkg\mod\github.com\go-vgo\[email protected]\robotgo_mac_win.go:76:9: undefined: showAlert
Description
set GOARCH=386
64-bit runs OK 32-bit failed to run How to fix ...
我也一样
same question
i have same error go 1.20
Just try this https://github.com/go-vgo/robotgo/issues/552#issuecomment-1664935423 Or https://github.com/go-vgo/robotgo/issues/582#issuecomment-1670531679
Just try this #552 (comment)
This did not work for me.
func main() {
robotgo.KeyTap("cmd", "d")
}
$ go version
go version go1.22.0 windows/amd64
$ go env | grep CGO_ENABLED
set CGO_ENABLED=1
$ gcc -v
clang version 18.1.0rc (https://github.com/llvm/llvm-project.git 461274b81d8641eab64d494accddc81d7db8a09e)
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: C:/Users/***********/LLVM-mingw/bin
$ go build
# github.com/go-vgo/robotgo
In file included from ..\..\pkg\mod\github.com\go-vgo\[email protected]\robotgo.go:42:
In file included from ..\..\pkg\mod\github.com\go-vgo\[email protected]/window/goWindow.h:12:
..\..\pkg\mod\github.com\go-vgo\[email protected]/window/window.h:18:6: warning: a function declaration without a prototype is deprecated in all versions of
C and is treated as a zero-parameter prototype in C23, conflicting with a subsequent definition [-Wdeprecated-non-prototype]
..\..\pkg\mod\github.com\go-vgo\[email protected]/window/window.h:25:6: note: conflicting prototype is here
# github.com/go-vgo/robotgo
..\..\pkg\mod\github.com\go-vgo\[email protected]\img.go:58:14: undefined: imgo.ToByteImg
..\..\pkg\mod\github.com\go-vgo\[email protected]\ps.go:23:9: cannot use ps.Pids() (value of type []int) as []int32 value in return statement
..\..\pkg\mod\github.com\go-vgo\[email protected]\ps.go:28:22: cannot use pid (variable of type int32) as int value in argument to ps.PidExists
..\..\pkg\mod\github.com\go-vgo\[email protected]\ps.go:37:4: cannot use nps[i].Pid (variable of type int) as int32 value in struct literal
..\..\pkg\mod\github.com\go-vgo\[email protected]\ps.go:49:21: cannot use pid (variable of type int32) as int value in argument to ps.FindName
..\..\pkg\mod\github.com\go-vgo\[email protected]\ps.go:61:9: cannot use ps.FindIds(name) (value of type []int) as []int32 value in return statement
..\..\pkg\mod\github.com\go-vgo\[email protected]\ps.go:66:21: cannot use pid (variable of type int32) as int value in argument to ps.FindPath
..\..\pkg\mod\github.com\go-vgo\[email protected]\ps.go:76:17: cannot use pid (variable of type int32) as int value in argument to ps.Kill
@wilon Nevermind. I fixed my issue by running
go get github.com/go-vgo/robotgo
I originally just added the import statement. Seems like running go get pulls a newer version, as this is what I got with the go get command:
$ go get github.com/go-vgo/robotgo
go: downloading github.com/go-vgo/robotgo v1.0.0-rc2.1
go: added github.com/gen2brain/shm v0.0.0-20230802011745-f2460f5984f7
go: upgraded github.com/go-vgo/robotgo v1.0.0-beta5.3 => v1.0.0-rc2.1
go: added github.com/jezek/xgb v1.1.0
go: added github.com/kbinani/screenshot v0.0.0-20230812210009-b87d31814237
@wilon没关系。我通过运行解决了我的问题
go get github.com/go-vgo/robotgo我最初只是添加了导入语句。似乎运行 go get 会拉取更新版本,因为这是我使用 go get 命令得到的结果:
$ go get github.com/go-vgo/robotgo go: downloading github.com/go-vgo/robotgo v1.0.0-rc2.1 go: added github.com/gen2brain/shm v0.0.0-20230802011745-f2460f5984f7 go: upgraded github.com/go-vgo/robotgo v1.0.0-beta5.3 => v1.0.0-rc2.1 go: added github.com/jezek/xgb v1.1.0 go: added github.com/kbinani/screenshot v0.0.0-20230812210009-b87d31814237
This is how I solved it, thank you very much
go get github.com/go-vgo/robotgo
solved my problem, thanks