Open salomeldc opened 2 years ago
Cross compile from Linux
to Windows
with CGO_ENABLED = 0
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build ./main.go
Thanks. When compiling on Linux with your version 0.2.0 (as I don't need the Objective C extension), I first have this issue :
/gopath/pkg/mod/github.com/electricbubble/go-toast@v0.2.0/toast_windows.go:46:13: undefined: os.WriteFile
/gopath/pkg/mod/github.com/electricbubble/go-toast@v0.2.0/toast_windows.go:203:11: undefined: os.WriteFile
When replacing os by ioutil, I then have this mistake :
/gopath/pkg/mod/github.com/electricbubble/go-toast@v0.2.0/toast.go:5:31: undefined: notification
/gopath/pkg/mod/github.com/electricbubble/go-toast@v0.2.0/toast.go:11:17: undefined: notification
/gopath/pkg/mod/github.com/electricbubble/go-toast@v0.2.0/toast.go:20:17: undefined: notification
/gopath/pkg/mod/github.com/electricbubble/go-toast@v0.2.0/toast.go:29:17: undefined: notification
/gopath/pkg/mod/github.com/electricbubble/go-toast@v0.2.0/toast.go:39:19: undefined: newNotification
And then :
Unknown field HideWindows in struct literal of type syscall.SysProcAttr
I didn't went further as it seems useless, but do you have any solution?
undefined: os.WriteFile
You should upgrade to Go 1.16
or later.
Hi, I want to build an application on Linux that will be using your package to send notification on Windows. Whn building I have this error :
# github.com/electricbubble/go-toast x86_64-w64-mingw32-gcc: fatal error: cannot execute 'cc1obj': execvp: No such file or directory compilation terminated.
Is it possible to do what I want to do ? If yes, how can I bypass this issue ?