kitech/qt.go

Windows support

PaluMacil opened this issue Β· 6 comments

Would you be open to keeping an issue open for adding Windows support? Devs that mostly use Windows are probably less likely to be able to write a Makefile that would work on Windows and less likely to know what you mean by installing various Qt modules, so without any Windows documentation, it really isn't properly cross-platform except for in theory. I came to Go from a mostly C# stack, so I don't have the C and tooling (make, cmake, understanding of how to integrate C/C++ dependencies) experience necessary to figure out how this could be fixed.

Of course I don't mean to demand anything since this is an open source project put together through your generosity, but it might be helpful to list the requirements to bridge the gap to get Windows users rolling.

Needed

  • Documentation
  • Makefile compatible with PowerShell (now the default shell)
  • Compiler toolchains that work (I always need to cycle through a lot of compilers before a project works on one in Windows)
  • Which Qt libraries need to be installed, how they need to be installed, where you get them / put them, etc.

That's very nice. I'm very interested in improving my understanding of building it on Windows, so I'd still love to see the things I listed, but I'll check this out tomorrow. I appreciate your time. πŸ‘

Thanks! I will be taking a look ASAP (which should be the weekend after next or so).

rusco commented

I confirm it works πŸ‘
I did it sligthly differently. I use the 64 bit version of http://tdm-gcc.tdragon.net/ which is easier to handle on Win10/64bit imo.

Then I unzipped the package https://github.com/qtchina/qtenv_win64 to my c:\userdata\qt directory and added c:\userdata\qt\bin to my Path Environment variable.

Then I ran these commands and it worked the first time:

cd c:\userdata\qt 
set CGO_CFLAGS=-Ic:/userdata/qt/include -Ic:/userdata/qt/lib/libffi-3.2.1/include/
set CGO_LDFLAGS=-Lc:/userdata/qt/lib


go get -u -v github.com/kitech/dl
go get -u -v github.com/kitech/qt.go
REM here I got a message : package github.com/kitech/qt.go: no Go files in  %GOPATH%/src/github.com/kitech/qt.go
REM might be a warning only that we are dealing with a directory and not a .go file 

go build %GOPATH%/src/github.com/kitech/qt.go/eg/button.go
button.exe

可δ»₯ε‚θ€ƒζˆ‘θΏ™η―‡ https://blog.csdn.net/wrzfeijianshen/article/details/82859923