go-gtk
go-gtk copied to clipboard
Building on Windows with -H windowsgui linker flag
Tried to build URTrator (https://github.com/pztrn/urtrator) on windows under MSYS2-MINGW64, everything went fine, except it won't launch if build command was go build -ldflags "-H windowsgui" -v
. This linker flag is needed to hide console. The error was "Unspecified fatal error encountered". Any ideas how to fix it?
I could build example/demo on go tip. What version of go do you use?
go version go1.7.1 windows/amd64
Indeed demo launched okay, but only if I launching it from MSYS2 console (as well as URTrator). If I launch it from explorer (of course in directory with copied GTK+2 libraries) - I still have "Unspecified fatal error encountered".
The only way I found is to use this package to hide console with syscall: https://github.com/couchbase/goutils/blob/master/platform/console_windows.go
As far as I see the google search, this is related gtk/windows. Sorry I have no idea to fix this.
The only way I found is to use this package to hide console with syscall:
Or one-liner
syscall.NewLazyDLL("kernel32").NewProc("FreeConsole").Call()
Yea, I know about this oneliner, just need a quickfix yesterday :)
BTW, maybe this should be added to README?
I think so. if you are okay, could you please send me pull-request to update README?
Yes, I'll make a PR today :)