go-vgo / robotgo

RobotGo, Go Native cross-platform RPA and GUI automation @vcaesar
Apache License 2.0
9.47k stars 862 forks source link

macos build linux error #562

Open simonwanghub opened 1 year ago

simonwanghub commented 1 year ago

macos 12.6.1 go version go1.19 darwin/amd64

master ±  CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o robot main.go

runtime/cgo

linux_syscall.c:67:13: error: implicit declaration of function 'setresgid' is invalid in C99 [-Werror,-Wimplicit-function-declaration] linux_syscall.c:67:13: note: did you mean 'setregid'? /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:593:6: note: 'setregid' declared here linux_syscall.c:73:13: error: implicit declaration of function 'setresuid' is invalid in C99 [-Werror,-Wimplicit-function-declaration] linux_syscall.c:73:13: note: did you mean 'setreuid'? /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:595:6: note: 'setreuid' declared here

shayneoneill commented 1 year ago

I'm not sure how you expected that combination of build parameters to work on a Mac?!

Try getting rid of the build flags. They seem to be for linux. Macs do not run linux.