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.45k stars 744 forks source link

qtdeploy failed with msys2 #1013

Open huiminghao opened 4 years ago

huiminghao commented 4 years ago

From the doc, it seems the msys2 version is not officially supported. BUT I really want it cloud work.
I used to use MinGW version of QT official relase, but found it hard to ship with 3rd party libraries. I think msys2 is the greatest dev env for win7/win10.

I found the docker labeled windows/msys2/shared, but I dont think its my way to use therecipe/qt, since the msys2 rolls every week and I need it to compile other src.

The qtsetup succeeds with warning:


time="2019-11-11T09:44:19+08:00" level=info msg="installing full qt/androidextras"
github.com/therecipe/qt/androidextras
# github.com/therecipe/qt/androidextras
vendor\github.com\therecipe\qt\androidextras\androidextras.go:19:10: undefined: QAndroidJniEnvironment

time="2019-11-11T09:44:19+08:00" level=info msg="installing full qt/gui"
...
time="2019-11-11T09:45:29+08:00" level=info msg="installing full qt/remoteobjects"
time="2019-11-11T09:45:31+08:00" level=warning msg="failed to install:"
time="2019-11-11T09:45:31+08:00" level=warning msg=androidextras

When I tried to deploy basic/qml, I gets:

qtdeploy.exe -debug build windows basic/qml/
time="2019-11-11T09:45:41+08:00" level=debug msg="running Deploy" comply=false docker=false fast=false ldFlags= mode=build path="C:\\msys64\\home\\haohuiming\\go\\src\\examples\\basic\\qml" quickcompiler=false target=windows useuic=true
...
# import config
packagefile github.com/therecipe/qt/core=C:\Users\haohuiming\AppData\Local\go-build\1a\1a2b99dc1cec1e640084d95f863c7a66102022363670da7ac10ec7ee245026a9-d
packagefile github.com/therecipe/qt/gui=C:\Users\haohuiming\AppData\Local\go-build\fe\fe1839b80baa24ec3db29276a65ff203d40aba92cefe934fd1fc8946bb2de419-d
packagefile github.com/therecipe/qt/qml=C:\Users\haohuiming\AppData\Local\go-build\7e\7e72dbb2363a0b4c494315907940f141d0fef6f30a9b36269fb90b9f32412b83-d
packagefile github.com/therecipe/qt/quickcontrols2=C:\Users\haohuiming\AppData\Local\go-build\6e\6ef392e617ccf817a748ce1f5dcf4ab7d8595315f3c05435e8c0e669e50d72c0-d
packagefile os=C:\Users\haohuiming\AppData\Local\go-build\56\56c6e8c7dcabb5092189107fff7ecaf2360d5aeee0255d2f3372241c7f1eb8a4-d
packagefile runtime/cgo=C:\Users\haohuiming\AppData\Local\go-build\1f\1f6a30f2c00d16b3d2514892a4c20e22e3f67c82b752659e7d4e767251499a3b-d
packagefile syscall=C:\Users\haohuiming\AppData\Local\go-build\e4\e409021934096ed75a145a268c51cbe92a7be539111e70d2b06478694a3e2574-d
packagefile runtime=C:\Users\haohuiming\AppData\Local\go-build\06\0641d9906a04885b641a448523c99decd5a56e5c01e19fbee0508607f82ef608-d
EOF
"C:\\Go\\pkg\\tool\\windows_amd64\\compile.exe" -o "C:\\Users\\HAOHUI~1\\AppData\\Local\\Temp\\go-build684643366\\b001\\_pkg_.a" -trimpath "C:\\Users\\HAOHUI~1\\AppData\\Local\\Temp\\go-build684643366\\b001=>;C:\\msys64\\home\\haohuiming\\go\\src\\examples=>github.com/therecipe/examples@" -p main -lang=go1.13 -buildid 3wbvVQm6GRCXjmf9GGfL/3wbvVQm6GRCXjmf9GGfL -goversion go1.13.4 -D "" -importcfg "C:\\Users\\HAOHUI~1\\AppData\\Local\\Temp\\go-build684643366\\b001\\importcfg" -pack -c=4 "C:\\msys64\\home\\haohuiming\\go\\src\\examples\\basic\\qml\\main.go" "C:\\Users\\HAOHUI~1\\AppData\\Local\\Temp\\go-build684643366\\b001\\_cgo_gotypes.go" "C:\\Users\\HAOHUI~1\\AppData\\Local\\Temp\\go-build684643366\\b001\\rcc_cgo_windows_windows_amd64.cgo1.go" "C:\\Users\\HAOHUI~1\\AppData\\Local\\Temp\\go-build684643366\\b001\\_cgo_import.go" "C:\\Users\\HAOHUI~1\\AppData\\Local\\Temp\\go-build684643366\\b001\\_gomod_.go"
# github.com/therecipe/examples/basic/qml
.\main.go:17:2: undefined: core.QCoreApplication_SetAttribute
.\main.go:17:37: undefined: core.Qt__AA_EnableHighDpiScaling
.\main.go:20:2: undefined: gui.NewQGuiApplication
.\main.go:25:2: undefined: quickcontrols2.QQuickStyle_SetStyle
.\main.go:28:12: undefined: qml.NewQQmlApplicationEngine
.\main.go:32:14: undefined: core.NewQUrl3
.\main.go:39:2: undefined: gui.QGuiApplication_Exec

Thanks for all your work.

therecipe commented 4 years ago

Hey

I will look into this. It could be that go modules aren't supported with msys2 atm, but I'm not really sure.

akiyosi commented 4 years ago

hi,

@huiminghao I work fine in the environment of Win10 + MSYS2. I think you would need to provide a little more information to solve this problem. For example, Qt version you using (official version or MSYS2 version), setup of various environment variables, s.t. GO111MODULE, QT_VERSION, QT_DIR, QT_MSYS2_ARCH, etc...

ergoz commented 4 years ago

@akiyosi tell me please how you setup? i tried msys and official version of QT and no luck with only one error:

time="2020-03-21T02:09:08+03:00" level=info msg="installing full qt/core"
github.com/therecipe/qt/core
# github.com/therecipe/qt/core
core.cpp:10:3: error: #error ------------------------------------------------------------------
   10 |  #error ------------------------------------------------------------------
      |   ^~~~~
core.cpp:11:3: error: #error please run: '$(go env GOPATH)/bin/qtsetup'
   11 |  #error please run: '$(go env GOPATH)/bin/qtsetup'
      |   ^~~~~
core.cpp:12:3: error: #error more info here: https:
   12 |  #error more info here: https://github.com/therecipe/qt/wiki/Installation
      |   ^~~~~
core.cpp:13:3: error: #error ------------------------------------------------------------------
   13 |  #error ------------------------------------------------------------------
      |   ^~~~~
core.cpp:15:10: fatal error: QAbstractAnimation: No such file or directory
   15 | #include <QAbstractAnimation>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.

time="2020-03-21T02:12:30+03:00" level=error msg="failed to install 'core'; aborting setup"
muesli commented 4 years ago

Same error as @ergoz got here.