therecipe / qt

Qt binding for Go (Golang) with support for Windows / macOS / Linux / FreeBSD / Android / iOS / Sailfish OS / Raspberry Pi / AsteroidOS / Ubuntu Touch / JavaScript / WebAssembly
GNU Lesser General Public License v3.0
10.49k stars 748 forks source link

windows installation #684

Closed xaria-coin closed 6 years ago

xaria-coin commented 6 years ago

having issues with the windows installation guide, got linux working fine but windows is causing a headache!

the final section in the windows installation instructions is to run $GOPATH/bin/qtsetup which looks like a linux command, not windows

but i just get the error - qtsetup is not recognized as an internal or external command etc etc etc

probably a simple fix but im relatively new to this so any help would be appreciated, thanks

akiyosi commented 6 years ago

Have tried %GOPATH%\bin\qtsetup.exe ?

xaria-coin commented 6 years ago

Didn't seem to work either

xaria-coin commented 6 years ago

I've tried a few times but in that directory there is no qtsetup, but there was on Linux? I know I've gone wrong somewhere but I've gone through everything twice now and can't see what I've missed

akiyosi commented 6 years ago

what Qt version are you using? (official or MSYS2) if you using MSYS2 version, $GOPATH/bin/qtsetup in the installation document is correct.

And also check that another command written in golang is created in %GOPATH%\bin (or $GOPATH/bin in MSYS2 MinGW shell)

xaria-coin commented 6 years ago

the install instructions for windows seem to be missing a step or two, ive managed to get qtsetup to run but it fails still msys2 installs mingw64 with empty directories which cause a fail as gcc compiler is missing, installed mingw64 through their separate installer which allows qtsetup to run but i then get failure - static assertion failure

xaria-coin commented 6 years ago

ive uninstalled, and gone through every step word by word 3 times and its not working, tried a few different methods and cant get them working. on linux it took maybe an hour or so of fiddling but windows is just a pain, did try to cross compile, which deployed ok, but then back in windows the program would run but no gui would come up (i could tell it run as it generated its log file)

therecipe commented 6 years ago

@xaria-coin The basic installation should be pretty similar to the one on Linux or macOS.

First you will need to install Qt: https://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe

then you will need to add the directory containing g++ to your PATH (C:\Qt\Tools\mingw530_32\bin or some similar path depending on your Qt installation) sorry, this was somehow missing in the instructions

then you will need to install Go: https://golang.org/doc/install?download=go1.10.3.windows-amd64.msi (and maybe git if you haven't already)

then simply run go get -v github.com/therecipe/qt/cmd/... to get qtsetup, qtdeploy, ...

and lastly run: %GOPATH%\bin\qtsetup.exe (you can get your GOPATH with go env GOPATH or go env)

xaria-coin commented 6 years ago

that seems to have got me a bit further one but still getting errors...

Microsoft Windows [Version 10.0.16299.547] (c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\klifford>%GOPATH%\bin\qtsetup.exe INFO[0000] running: 'qtsetup prep' INFO[0000] running: 'qtsetup check windows' [docker=false] [vagrant=false] INFO[0000] GOOS: 'windows' INFO[0000] GOARCH: 'amd64' INFO[0000] GOVERSION: 'go1.10.3' INFO[0000] GOROOT: 'C:\Go\' INFO[0000] GOPATH: 'C:\Users\klifford\go' INFO[0000] GOBIN: 'C:\Users\klifford\go\bin' INFO[0000] QT_HASH: '691e628621795f678575ad61b81ce41ced889427' INFO[0000] QT_VERSION: '5.10.1' INFO[0000] QT_VERSION_MAJOR: '5.10.1' INFO[0000] QT_DIR: 'C:\Qt' INFO[0000] QT_STUB: 'false' INFO[0000] QT_DEBUG: 'false' INFO[0000] QT_QMAKE_DIR: '' INFO[0000] QT_WEBKIT: 'false' INFO[0000] QT_MSYS2: 'true' INFO[0000] QT_MSYS2_DIR: 'C:\msys64\mingw64' INFO[0000] QT_MSYS2_ARCH: 'amd64' INFO[0000] QT_MSYS2_STATIC: 'false' INFO[0000] running: 'qtsetup generate windows' [docker=false] [vagrant=false] INFO[0004] generating full qt/core INFO[0007] generating full qt/androidextras INFO[0007] generating full qt/gui INFO[0017] generating full qt/network INFO[0018] generating full qt/xml INFO[0019] generating full qt/dbus INFO[0019] generating full qt/nfc INFO[0020] generating full qt/script INFO[0021] generating full qt/sensors INFO[0022] generating full qt/positioning INFO[0023] generating full qt/widgets INFO[0033] generating full qt/sql INFO[0034] generating full qt/qml INFO[0034] generating full qt/websockets INFO[0035] generating full qt/xmlpatterns INFO[0035] generating full qt/bluetooth INFO[0036] generating full qt/webchannel INFO[0037] generating full qt/svg INFO[0037] generating full qt/multimedia INFO[0040] generating full qt/quick INFO[0042] generating full qt/help INFO[0043] generating full qt/location INFO[0044] generating full qt/scripttools INFO[0044] generating full qt/uitools INFO[0044] generating full qt/winextras INFO[0045] generating full qt/testlib INFO[0045] generating full qt/serialport INFO[0046] generating full qt/serialbus INFO[0047] generating full qt/printsupport INFO[0048] generating full qt/designer INFO[0049] generating full qt/scxml INFO[0050] generating full qt/gamepad INFO[0050] generating full qt/datavisualization INFO[0051] generating full qt/charts INFO[0054] generating full qt/speech INFO[0054] generating full qt/quickcontrols2 INFO[0054] generating full qt/sailfish INFO[0054] generating full qt/remoteobjects INFO[0055] running: 'qtsetup install windows' [docker=false] [vagrant=false] INFO[0055] installing full qt/core ERRO[0085] failed to run command cmd="go install -p 4 -v github.com/therecipe/qt/core" env="TMP=C:\Users\klifford\AppData\Local\Temp TEMP=C:\Users\klifford\AppData\Local\Temp CGO_CFLAGS_ALLOW=. GOROOT=C:\Go\ GOARCH=amd64 CGO_ENABLED=1 PATH=C:\msys64\mingw64\bin;C:\Qt\Qt5.10.1\Tools\mingw530_32\bin;C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\Python36-32\Scripts\;C:\Program Files (x86)\Python36-32\;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32_win\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Program Files\Geth;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\PuTTY\;C:\Users\klifford\go\bin;C:\Go\;C:\Go\bin\;C:\Users\klifford\go\;C:\Users\klifford\go\bin\;C:\Program Files (x86)\ATMEL\FLIP 2.4.6\bin;C:\Users\klifford\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Nmap;C:\Program Files (x86)\Python36-32\;C:\boost_1_67_0;C:\Users\klifford\AppData\Roaming\npm;C:\Users\klifford\AppData\Local\GitHubDesktop\bin;C:\Users\klifford\go\bin GOPATH=C:\Users\klifford\go CGO_CXXFLAGS_ALLOW=. CGO_LDFLAGS_ALLOW=.* GOOS=windows" error="exit status 2" func=RunCmdOptionalError name="install core" github.com/therecipe/qt github.com/therecipe/qt/core

github.com/therecipe/qt/core

In file included from go\src\github.com\therecipe\qt\core\core.go:8, from _cgo_export.c:3: go\src\github.com\therecipe\qt\core/core.h:69:60: warning: parameter 2 ('currentLoop') has void type void QAbstractAnimation_CurrentLoopChanged(void* ptr, void currentLoop);


go\src\github.com\therecipe\qt\core/core.h:72:58: warning: parameter 2 ('newDirection') has void type
 void QAbstractAnimation_DirectionChanged(void* ptr, void newDirection);
                                                     ~~~~~^~~~~~~~~~~~
go\src\github.com\therecipe\qt\core/core.h:82:54: warning: parameter 2 ('newState') has void type
 void QAbstractAnimation_StateChanged(void* ptr, void newState, void oldState);
                                                 ~~~~~^~~~~~~~
go\src\github.com\therecipe\qt\core/core.h:82:69: warning: parameter 3 ('oldState') has void type
 void QAbstractAnimation_StateChanged(void* ptr, void newState, void oldState);
                                                                ~~~~~^~~~~~~~
go\src\github.com\therecipe\qt\core/core.h:123:53: warning: parameter 2 ('topLeft') has void type
 void QAbstractItemModel_DataChanged(void* ptr, void topLeft, void bottomRight, void roles);
                                                ~~~~~^~~~~~~
go\src\github.com\therecipe\qt\core/core.h:123:67: warning: parameter 3 ('bottomRight') has void type
 void QAbstractItemModel_DataChanged(void* ptr, void topLeft, void bottomRight, void roles);
                                                              ~~~~~^~~~~~~~~~~
go\src\github.com\therecipe\qt\core/core.h:123:85: warning: parameter 4 ('roles') has void type
 void QAbstractItemModel_DataChanged(void* ptr, void topLeft, void bottomRight, void roles);
                                                                                ~~~~~^~~~~
go\src\github.com\therecipe\qt\core/core.h:133:59: warning: parameter 2 ('orientation') has void type
 void QAbstractItemModel_HeaderDataChanged(void* ptr, void orientation, void first, void last);
                                                      ~~~~~^~~~~~~~~~~
go\src\github.com\therecipe\qt\core/core.h:133:77: warning: parameter 3 ('first') has void type
 void QAbstractItemModel_HeaderDataChanged(void* ptr, void orientation, void first, void last);
                                                                        ~~~~~^~~~~
go\src\github.com\therecipe\qt\core/core.h:133:89: warning: parameter 4 ('last') has void type
 void QAbstractItemModel_HeaderDataChanged(void* ptr, void orientation, void first, void last);
                                                                                    ~~~~~^~~~
go\src\github.com\therecipe\qt\core/core.h:136:64: warning: parameter 2 ('parents') has void type
 void QAbstractItemModel_LayoutAboutToBeChanged(void* ptr, void parents, void hint);
                                                           ~~~~~^~~~~~~
go\src\github.com\therecipe\qt\core/core.h:136:78: warning: parameter 3 ('hint') has void type
 void QAbstractItemModel_LayoutAboutToBeChanged(void* ptr, void parents, void hint);
                                                                         ~~~~~^~~~
go\src\github.com\therecipe\qt\core/core.h:139:55: warning: parameter 2 ('parents') has void type
 void QAbstractItemModel_LayoutChanged(void* ptr, void parents, void hint);
                                                  ~~~~~^~~~~~~
go\src\github.com\therecipe\qt\core/core.h:139:69: warning: parameter 3 ('hint') has void type
 void QAbstractItemModel_LayoutChanged(void* ptr, void parents, void hint);
                                                                ~~~~~^~~~
go\src\github.com\therecipe\qt\core/core.h:1230:72: warning: parameter 2 ('current') has void type
 void QSequentialAnimationGroup_CurrentAnimationChanged(void* ptr, void current);
                                                                   ~~~~~^~~~~~~
go\src\github.com\therecipe\qt\core/core.h:1355:51: warning: parameter 2 ('running') has void type
 void QStateMachine_RunningChanged(void* ptr, void running);
                                              ~~~~~^~~~~~~
go\src\github.com\therecipe\qt\core/core.h:1771:53: warning: parameter 2 ('value') has void type
 void QVariantAnimation_ValueChanged(void* ptr, void value);
                                                ~~~~~^~~~~
# github.com/therecipe/qt/core
In file included from go\src\github.com\therecipe\qt\core\core.go:8:
go\src\github.com\therecipe\qt\core/core.h:69:60: warning: parameter 2 ('currentLoop') has void type
 void QAbstractAnimation_CurrentLoopChanged(void* ptr, void currentLoop);
                                                       ~~~~~^~~~~~~~~~~
go\src\github.com\therecipe\qt\core/core.h:72:58: warning: parameter 2 ('newDirection') has void type
 void QAbstractAnimation_DirectionChanged(void* ptr, void newDirection);
                                                     ~~~~~^~~~~~~~~~~~
go\src\github.com\therecipe\qt\core/core.h:82:54: warning: parameter 2 ('newState') has void type
 void QAbstractAnimation_StateChanged(void* ptr, void newState, void oldState);
                                                 ~~~~~^~~~~~~~
go\src\github.com\therecipe\qt\core/core.h:82:69: warning: parameter 3 ('oldState') has void type
 void QAbstractAnimation_StateChanged(void* ptr, void newState, void oldState);
                                                                ~~~~~^~~~~~~~
go\src\github.com\therecipe\qt\core/core.h:123:53: warning: parameter 2 ('topLeft') has void type
 void QAbstractItemModel_DataChanged(void* ptr, void topLeft, void bottomRight, void roles);
                                                ~~~~~^~~~~~~
go\src\github.com\therecipe\qt\core/core.h:123:67: warning: parameter 3 ('bottomRight') has void type
 void QAbstractItemModel_DataChanged(void* ptr, void topLeft, void bottomRight, void roles);
                                                              ~~~~~^~~~~~~~~~~
go\src\github.com\therecipe\qt\core/core.h:123:85: warning: parameter 4 ('roles') has void type
 void QAbstractItemModel_DataChanged(void* ptr, void topLeft, void bottomRight, void roles);
                                                                                ~~~~~^~~~~
go\src\github.com\therecipe\qt\core/core.h:133:59: warning: parameter 2 ('orientation') has void type
 void QAbstractItemModel_HeaderDataChanged(void* ptr, void orientation, void first, void last);
                                                      ~~~~~^~~~~~~~~~~
go\src\github.com\therecipe\qt\core/core.h:133:77: warning: parameter 3 ('first') has void type
 void QAbstractItemModel_HeaderDataChanged(void* ptr, void orientation, void first, void last);
                                                                        ~~~~~^~~~~
go\src\github.com\therecipe\qt\core/core.h:133:89: warning: parameter 4 ('last') has void type
 void QAbstractItemModel_HeaderDataChanged(void* ptr, void orientation, void first, void last);
                                                                                    ~~~~~^~~~
go\src\github.com\therecipe\qt\core/core.h:136:64: warning: parameter 2 ('parents') has void type
 void QAbstractItemModel_LayoutAboutToBeChanged(void* ptr, void parents, void hint);
                                                           ~~~~~^~~~~~~
go\src\github.com\therecipe\qt\core/core.h:136:78: warning: parameter 3 ('hint') has void type
 void QAbstractItemModel_LayoutAboutToBeChanged(void* ptr, void parents, void hint);
                                                                         ~~~~~^~~~
go\src\github.com\therecipe\qt\core/core.h:139:55: warning: parameter 2 ('parents') has void type
 void QAbstractItemModel_LayoutChanged(void* ptr, void parents, void hint);
                                                  ~~~~~^~~~~~~
go\src\github.com\therecipe\qt\core/core.h:139:69: warning: parameter 3 ('hint') has void type
 void QAbstractItemModel_LayoutChanged(void* ptr, void parents, void hint);
                                                                ~~~~~^~~~
go\src\github.com\therecipe\qt\core/core.h:1230:72: warning: parameter 2 ('current') has void type
 void QSequentialAnimationGroup_CurrentAnimationChanged(void* ptr, void current);
                                                                   ~~~~~^~~~~~~
go\src\github.com\therecipe\qt\core/core.h:1355:51: warning: parameter 2 ('running') has void type
 void QStateMachine_RunningChanged(void* ptr, void running);
                                              ~~~~~^~~~~~~
go\src\github.com\therecipe\qt\core/core.h:1771:53: warning: parameter 2 ('value') has void type
 void QVariantAnimation_ValueChanged(void* ptr, void value);
                                                ~~~~~^~~~~
continued in the qterrors.txt file as too much to paste into here....

any help would be appreciated
thanks ;)
[qterrors.txt](https://github.com/therecipe/qt/files/2282046/qterrors.txt)
therecipe commented 6 years ago

Mh, you are using the official version of Qt now or? If yes, then maybe try to unset QT_MSYS2 and QT_MSYS2_DIR and also remove C:\msys64\mingw64\bin from your PATH.

Then it should work, I hope.

xaria-coin commented 6 years ago

It was all me being a pleb, where I'd not been paying attention I tried both the normal qt version and the msys2 version so there were conflicts Thanks for all your help guys ;)

therecipe commented 6 years ago

you are welcome :)