fyne-io / systray

a cross platfrom Go library to place an icon and menu in the notification area
Apache License 2.0
227 stars 42 forks source link

Cross Compilation #13

Closed mrpalide closed 2 years ago

mrpalide commented 2 years ago

Does available cross compilation for systray? When I trying to build for MacOS on Linux machine, by GOOS=darwin GOARCH=amd64 go build example/main.go I get this error:

# github.com/fyne-io/systray
./systray.go:72:2: undefined: setInternalLoop
./systray.go:75:2: undefined: nativeLoop
./systray.go:83:9: undefined: nativeStart
./systray.go:83:22: undefined: nativeEnd
./systray.go:111:2: undefined: registerSystray
./systray.go:116:14: undefined: quit
./systray.go:141:2: undefined: addSeparator
./systray.go:195:2: undefined: hideMenuItem
./systray.go:200:2: undefined: showMenuItem
./systray.go:225:2: undefined: addOrUpdateMenuItem
./systray.go:225:2: too many errors

But is OK for windows, by GOOS=windows GOARCH=amd64 go build example/main.go!

andydotxyz commented 2 years ago

When compiling for other OS Go will turn off CGo support, but systray requires it. Please include CGO_ENABLED=1. You may also need the appropriate C compiler - there are more docs at https://developer.fyne.io/started/cross-compiling