qt.go icon indicating copy to clipboard operation
qt.go copied to clipboard

Windows support

Open PaluMacil opened this issue 7 years ago β€’ 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.

PaluMacil avatar Feb 20 '18 17:02 PaluMacil

prebuild version here: https://github.com/kitech/qt.inline/releases/tag/v1.0-rc.1

kitech avatar Feb 24 '18 18:02 kitech

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. πŸ‘

PaluMacil avatar Feb 24 '18 23:02 PaluMacil

  • windows document: https://github.com/kitech/qt.go/blob/master/install.md
  • Makefile: really not need on windows, but if there is a PS one, that good
  • Compiler toolchains: see install.md, mingw64 gcc is used.
  • Which Qt libraries: Qt5.10 is needed. there is prebuild static windows qt version Qt5Inline here for preview purpose: https://github.com/qtchina/qtenv_win32/
  • Examples: https://github.com/kitech/qt.go/issues/12#issuecomment-370625326 , https://github.com/kitech/qt.go/blob/master/eg/button.go

kitech avatar Mar 06 '18 02:03 kitech

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

PaluMacil avatar Mar 07 '18 00:03 PaluMacil

I confirm it works :+1: 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

rusco avatar Mar 07 '18 17:03 rusco

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

wrzfeijianshen avatar Sep 26 '18 14:09 wrzfeijianshen