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

support custom build mingw static qt #599

Open ismlsmile opened 6 years ago

ismlsmile commented 6 years ago

I build a mingw static qt myself, and try to use qtsetup. The static mingw qt is in "D:\Dev\Qt5.10.0-static". I use the mingw inclueded in qt installer.

  1. I open the mingw shell and set QT_DIR and QT_VERSION
  2. qtsetup

The command failed as it want to find "D:\Dev\Qt5.10.0-static\5.10.0\mingw53_32\bin\qmake". Then I move the staitc mingw qt dirs to "D:\Dev\Qt5.10.0-static\5.10.0\mingw53_32" and this error disappers.

And I tried qtsetup again, there are many erros, the program crashed at:

WARN[0266] parser.LoadModule error=EOF module=QuickControls2 WARN[0266] parser.LoadModule error=EOF module=Quick panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x1 addr=0x110 pc=0x6efde3]

goroutine 1 [running]: github.com/therecipe/qt/internal/cmd/minimal.Minimal(0xc0422436e0, 0x54, 0x80932f, 0x7, 0x0, 0x0) J:/Code/oschina/GOPATH/src/github.com/therecipe/qt/internal/cmd/minimal/minimal.go:150 +0xad3 github.com/therecipe/qt/internal/cmd/deploy.Deploy(0x807ca4, 0x4, 0x80932f, 0x7, 0xc0422436e0, 0x54, 0xc042018000, 0x0, 0x0, 0x0, ...) J:/Code/oschina/GOPATH/src/github.com/therecipe/qt/internal/cmd/deploy/deploy.go:61 +0xe29 github.com/therecipe/qt/internal/cmd/setup.Test(0x80932f, 0x7, 0x800000, 0x0, 0x0) J:/Code/oschina/GOPATH/src/github.com/therecipe/qt/internal/cmd/setup/test.go:148 +0x72c main.main() J:/Code/oschina/GOPATH/src/github.com/therecipe/qt/cmd/qtsetup/main.go:99 +0x336

therecipe commented 6 years ago

Hey

What folder does D:\Dev\Qt5.10.0-static contain ? (bin, include, lib, share) ?

If you use one of the msys shells or if you set MSYS2=true, thenQT_DIR will probably have no effect. So you will either need to try to set QT_MSYS2_DIR or QT_QMAKE_DIR.

I think QT_QMAKE_DIR is probably you best bet.

Another idea would be to use the pre-built static msys version and then simply replace the lib and bin folder with your self compiled version.

ismlsmile commented 6 years ago

sorry, I did not make it clear how I setup the env. I tried QT_QMAKE_DIR, but still failed.Here is the detail:

  1. OS: Win10
  2. I did not install msys2, I used the mingw versin included in Qt 5.10.0 installer.
  3. I used the above mingw and compiled a static mingw version to "D:\Dev\Qt5.10.0-static". The folder is created by "mingw32-make install". And this folder contains "bin, include, lib..."
  4. I add the mingw/bin dir to path env
  5. I open a cmd window (1) set QT_DIR=D:\Dev\Qt5.10.0-static (2) set QT_QMAKE_DIR=D:\Dev\Qt5.10.0-static\bin (3) set QT_VERSION=5.10.0 (4) qtsetup

finally, the program crashed at:

INFO[0259] installing full qt/speech INFO[0265] installing full qt/quickcontrols2 INFO[0271] installing full qt/sailfish INFO[0271] installing full qt/remoteobjects WARN[0277] failed to install: WARN[0277] androidextras INFO[0277] running: 'qtsetup test windows' [docker=false] [vagrant=false] INFO[0277] testing qml\application ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtnetwork\qtnetwork.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtnetwork\qtnetwork.index: The system cannot find the path specified." WARN[0282] parser.LoadModule error=EOF module=Network ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qthelp\qthelp.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qthelp\qthelp.index: The system cannot find the path specified." WARN[0282] parser.LoadModule error=EOF module=Help ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtspeech\qtspeech.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtspeech\qtspeech.index: The system cannot find the path specified." WARN[0282] parser.LoadModule error=EOF module=Speech ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtscxml\qtscxml.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtscxml\qtscxml.index: The system cannot find the path specified." WARN[0282] parser.LoadModule error=EOF module=Scxml ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtquickcontrols2\qtquickcontrols2.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtquickcontrols2\qtquickcontrols2.index: The system cannot find the path specified." WARN[0282] parser.LoadModule error=EOF module=QuickControls2 ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtsql\qtsql.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtsql\qtsql.index: The system cannot find the path specified." WARN[0282] parser.LoadModule error=EOF module=Sql ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtqml\qtqml.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtqml\qtqml.index: The system cannot find the path specified." WARN[0282] parser.LoadModule error=EOF module=Qml ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtscript\qtscript.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtscript\qtscript.index: The system cannot find the path specified." WARN[0282] parser.LoadModule error=EOF module=Script ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtsensors\qtsensors.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtsensors\qtsensors.index: The system cannot find the path specified." WARN[0282] parser.LoadModule error=EOF module=Sensors ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtsvg\qtsvg.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtsvg\qtsvg.index: The system cannot find the path specified." WARN[0282] parser.LoadModule error=EOF module=Svg ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtgui\qtgui.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtgui\qtgui.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtremoteobjects\qtremoteobjects.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtremoteobjects\qtremoteobjects.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtpositioning\qtpositioning.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtpositioning\qtpositioning.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtmultimedia\qtmultimedia.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtmultimedia\qtmultimedia.index: The system cannot find the path specified." WARN[0282] parser.LoadModule error=EOF module=Multimedia ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtwebsockets\qtwebsockets.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtwebsockets\qtwebsockets.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtxml\qtxml.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtxml\qtxml.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtandroidextras\qtandroidextras.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtandroidextras\qtandroidextras.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtgamepad\qtgamepad.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtgamepad\qtgamepad.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtuitools\qtuitools.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtuitools\qtuitools.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtcharts\qtcharts.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtcharts\qtcharts.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtdbus\qtdbus.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtdbus\qtdbus.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtwinextras\qtwinextras.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtwinextras\qtwinextras.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtpurchasing\qtpurchasing.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtpurchasing\qtpurchasing.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtserialbus\qtserialbus.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtserialbus\qtserialbus.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtdatavisualization\qtdatavisualization.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtdatavisualization\qtdatavisualization.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtprintsupport\qtprintsupport.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtprintsupport\qtprintsupport.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtwidgets\qtwidgets.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtwidgets\qtwidgets.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtdesigner\qtdesigner.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtdesigner\qtdesigner.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtnfc\qtnfc.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtnfc\qtnfc.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtserialport\qtserialport.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtserialport\qtserialport.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtwebchannel\qtwebchannel.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtwebchannel\qtwebchannel.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtxmlpatterns\qtxmlpatterns.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtxmlpatterns\qtxmlpatterns.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtbluetooth\qtbluetooth.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtbluetooth\qtbluetooth.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtlocation\qtlocation.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtlocation\qtlocation.index: The system cannot find the path specified." WARN[0282] parser.LoadModule error=EOF module=Location WARN[0282] parser.LoadModule error=EOF module=RemoteObjects ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtquick\qtquick.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtquick\qtquick.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtscripttools\qtscripttools.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtscripttools\qtscripttools.index: The system cannot find the path specified." WARN[0282] parser.LoadModule error=EOF module=ScriptTools WARN[0282] parser.LoadModule error=EOF module=Positioning WARN[0282] parser.LoadModule error=EOF module=Xml WARN[0282] parser.LoadModule error=EOF module=Gui WARN[0282] parser.LoadModule error=EOF module=Gamepad ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtcore\qtcore.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtcore\qtcore.index: The system cannot find the path specified." ERRO[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qttestlib\qttestlib.index error="open D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qttestlib\qttestlib.index: The system cannot find the path specified." WARN[0282] parser.LoadModule error=EOF module=AndroidExtras WARN[0282] parser.LoadModule error=EOF module=UiTools WARN[0282] parser.LoadModule error=EOF module=DBus WARN[0282] parser.LoadModule error=EOF module=WinExtras WARN[0282] parser.LoadModule error=EOF module=SerialBus WARN[0282] parser.LoadModule error=EOF module=Purchasing WARN[0282] parser.LoadModule error=EOF module=PrintSupport WARN[0282] parser.LoadModule error=EOF module=Widgets WARN[0282] parser.LoadModule error=EOF module=Designer WARN[0282] parser.LoadModule error=EOF module=Nfc WARN[0282] parser.LoadModule error=EOF module=SerialPort WARN[0282] parser.LoadModule error=EOF module=WebChannel WARN[0282] parser.LoadModule error=EOF module=XmlPatterns WARN[0282] parser.LoadModule error=EOF module=Bluetooth WARN[0282] parser.LoadModule error=EOF module=Quick WARN[0282] parser.LoadModule error=EOF module=WebSockets WARN[0282] parser.LoadModule error=EOF module=TestLib WARN[0282] parser.LoadModule error=EOF module=Core panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x1 addr=0x110 pc=0x6efe23]

goroutine 1 [running]: github.com/therecipe/qt/internal/cmd/minimal.Minimal(0xc0424061e0, 0x54, 0x809374, 0x7, 0x0, 0x0) J:/Code/GOPATH/src/github.com/therecipe/qt/internal/cmd/minimal/minimal.go:150 +0xad3 github.com/therecipe/qt/internal/cmd/deploy.Deploy(0x807ce4, 0x4, 0x809374, 0x7, 0xc0424061e0, 0x54, 0xc04201a500, 0x0, 0x0, 0x0, ...) J:/Code/GOPATH/src/github.com/therecipe/qt/internal/cmd/deploy/deploy.go:61 +0xe29 github.com/therecipe/qt/internal/cmd/setup.Test(0x809374, 0x7, 0x800000, 0x0, 0x0) J:/Code/GOPATH/src/github.com/therecipe/qt/internal/cmd/setup/test.go:148 +0x72c main.main() J:/Code/GOPATH/src/github.com/therecipe/qt/cmd/qtsetup/main.go:99 +0x336

therecipe commented 6 years ago

Ah, sorry for the mix up. For a plain normal mingw version the process should be pretty straightforward.

You probably just need to do:

QT_DIR needs to be set to the root folder otherwise the generator can't find the *.index files at the place it expects them to be. And then you will get something like this:

�[31mERRO�[0m[0282] failed to load D:\Dev\Qt5.10.0-static\Docs\Qt-5.10.0\qtcore\qtcore.index


However, if this won't work then maybe try to symlink the D:\Dev\Qt5.10.0-static folder as mingw53_32 in path/to/the/initial/root/Qt/dir/5.10.0/ instead and unset QT_QMAKE_DIR before running the setup

ismlsmile commented 6 years ago

I tried these two methods, they report the same error: core.cpp:9:30: fatal error: QAbstractAnimation: No such file or directory compilation terminated.

therecipe commented 6 years ago

I tried these two methods, they report the same error: core.cpp:9:30: fatal error: QAbstractAnimation: No such file or directory compilation terminated.

Mh, did you get any errors while running qtsetup ? This error usually comes up, if the setup failed to generate proper cgo_* files. (If you take a look into the $GOPATH/src/github.com/therecipe/qt/core/cgo_* file, it should be probably pretty empty.)