Open wkj89 opened 5 years ago
me too :-
$ pwd /Users/conanchen/git/therecipe/examples/basic $ qtdeploy test desktop qml WARN[0002] parser.LoadModule error=EOF module=QuickControls2 WARN[0002] parser.LoadModule error=EOF module=Qml WARN[0002] parser.LoadModule error=EOF module=Network WARN[0002] parser.LoadModule error=EOF module=Core WARN[0002] parser.LoadModule error=EOF module=Gui ERRO[0003] failed to run command _func=RunCmd cmd="bash -c /usr/local/bin/go build -p 4 -v -o /Users/conanchen/git/therecipe/examples/basic/qml/deploy/darwin/qml_project.app/Contents/MacOS/qml_project -tags=minimal -ldflags=all=\"-w\"" dir=/Users/conanchen/git/therecipe/examples/basic/qml env="LANG=zh_CN.UTF-8 ITERM_PROFILE=Default LOGNAME=conanchen GOARCH=amd64 GOFLAGS=-mod=vendor CPPFLAGS=-I/usr/local/opt/qt/include LDFLAGS=-L/usr/local/opt/qt/lib TERM_PROGRAM=iTerm.app OSTYPE=darwin SHLVL=1 LC_TERMINAL_VERSION=3.3.2 HTTP_PROXY=127.0.0.1:1087 GOOS=darwin PUB_HOSTED_URL=https://pub.flutter-io.cn __CF_USER_TEXT_ENCODING=0x0:25:52 TERM_PROGRAMVERSION=3.3.2 =/Users/conanchen/go/bin/qtdeploy CGO_ENABLED=1 USER=conanchen COLORTERM=truecolor HTTPS_PROXY=127.0.0.1:1087 XPC_SERVICE_NAME=0 ITERM_SESSION_ID=w0t0p0:CEFA65FB-B0DD-4C5D-BC43-ACFC0E870C40 OLDPWD=/Users/conanchen/git/therecipe/examples/basic/qml SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.CbslYBimHQ/Listeners XPC_FLAGS=0x0 QT_DIR=/usr/local/Cellar/qt LC_TERMINAL=iTerm2 Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.RMOJ9UYPA6/Render PWD=/Users/conanchen/git/therecipe/examples/basic COLORFGBG=7;0 TERM=xterm-256color SHELL=/bin/bash TMPDIR=/var/folders/td/0ny4r8md2vg9lz2t2knwr7yr0000gn/T/ TERM_SESSION_ID=w0t0p0:CEFA65FB-B0DD-4C5D-BC43-ACFC0E870C40 QT_HOMEBREW=true PATH=/usr/local/opt/qt/bin:/Users/conanchen/go/bin:/Users/conanchen/Library/flutter/bin:/usr/local/opt/qt/bin:/Users/conanchen/go/bin:/Users/conanchen/Library/flutter/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin GOPATH=/Users/conanchen/go GOROOT=/usr/local/Cellar/go/1.13/libexec FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn HOME=/Users/conanchen" error="exit status 2" name="build for darwin on darwin" 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
$ qtsetup check darwin INFO[0000] running: 'qtsetup check darwin' [docker=false] [vagrant=false] INFO[0000] GOOS: 'darwin' INFO[0000] GOARCH: 'amd64' INFO[0000] GOVERSION: 'go1.13' INFO[0000] GOROOT: '/usr/local/Cellar/go/1.13/libexec' INFO[0000] GOPATH: '/Users/conanchen/git/therecipe/examples/vendor/github.com/therecipe/qt' INFO[0000] GOBIN: '/Users/conanchen/git/therecipe/examples/vendor/github.com/therecipe/qt/bin' INFO[0000] GOMOD: '/Users/conanchen/git/therecipe/examples/go.mod' INFO[0000] QT_HASH: '5b89e5062c99ac96cf0da217c00ff7d1f442a7eb' INFO[0000] QT_API: '' INFO[0000] QT_VERSION: '5.13.0' INFO[0000] QT_DIR: '/usr/local/Cellar/qt' INFO[0000] QT_STUB: 'false' INFO[0000] QT_DEBUG: 'false' INFO[0000] QT_QMAKE_DIR: '' INFO[0000] QT_WEBKIT: 'false' INFO[0000] QT_HOMEBREW: 'true' INFO[0000] QT_MACPORTS: 'false' INFO[0000] QT_NIX: 'false' INFO[0000] QT_FELGO: 'false' INFO[0000] XCODE_DIR: '/Applications/Xcode.app' INFO[0000] QT_PKG_CONFIG: 'false'
Hey
@wkj89
go run application.go QQmlApplicationEngine failed to load component qrc:/qml/application.qml:-1 No such file or directory
You will need to either use qtrcc && go run .
to bundle the *.qml file so that the qml engine can load it later.
Or change
app.Load(core.NewQUrl3("qrc:/qml/application.qml", 0))
to
app.Load(core.NewQUrl3("./qml/application.qml", 0))
to let the qml engine load the file from the disk instead.
cmd: qtdeploy -debug test desktop (well, nothing happened)
This should have worked though
widgets err
This seems to be caused by
malformed mach-o image: dylib load command #7 string extends beyond end of load command
maybe your HomeBrew Qt installation is broken somehow.
Does $(go env GOPATH)/bin/qtsetup test
work for you?
@conanchen
It seems like the *.index files couldn't be found:
WARN[0002] parser.LoadModule error=EOF module=Core WARN[0002] parser.LoadModule error=EOF module=Gui
Maybe try running:
go get -v github.com/therecipe/qt/internal/binding/files/docs/5.13.0
change app.Load(core.NewQUrl3("qrc:/qml/application.qml", 0)) to app.Load(core.NewQUrl3("./qml/application.qml", 0))
well,it worked for me! TKS~
$(go env GOPATH)/bin/qtsetup test
GOT Error when testing quick/calc
some info about the test:
INFO[0000] running: 'qtsetup test darwin' [docker=false] [vagrant=false]
INFO[0000] testing qml/gallery
INFO[0020] testing quick/calc
INFO[0039] testing widgets/textedit
INFO[0077] testing showcases/wallet
err for calc test:
Dyld Error Message:
Library not loaded: @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui
Referenced from: /Users/USER/*/calc.app/Contents/MacOS/calc
Reason: no suitable image found. Did find:
/Users/wkj89/go/src/github.com/therecipe/qt/internal/examples/quick/calc/deploy/darwin/calc.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/5/QtGui: malformed mach-o image: dylib load command #21 string extends beyond end of load command
/Users/wkj89/go/src/github.com/therecipe/qt/internal/examples/quick/calc/deploy/darwin/calc.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/5/QtGui: malformed mach-o image: dylib load command #21 string extends beyond end of load command
Hm, maybe try to re-install HomeBrews Qt version with something like:
brew uninstall qt && brew install qt
and then try to run $(go env GOPATH)/bin/qtsetup test
again.
How to test/run individual sample? I run "qtsetup test darwin" sucessfully, but failed to run "qtdeploy test darwin showcases/wallet" or "qtdeploy test desktop showcases/wallet"
ConandeMacBook-Pro:examples conanchen$ pwd /Users/conanchen/go/src/github.com/therecipe/qt/internal/examples
ConandeMacBook-Pro:examples conanchen$ qtsetup test darwin INFO[0000] running: 'qtsetup test darwin' [docker=false] [vagrant=false] INFO[0000] testing showcases/wallet INFO[0052] testing qml/gallery
ConandeMacBook-Pro:examples conanchen$ qtdeploy test darwin showcases/wallet/ ERRO[0023] failed to run command _func=RunCmd cmd="go build -p 4 -v -ldflags=all=\"-w\" -o /Users/conanchen/go/src/github.com/therecipe/qt/internal/examples/showcases/wallet/deploy/darwin/wallet.app/Contents/MacOS/wallet -tags=minimal" dir=/Users/conanchen/go/src/github.com/therecipe/qt/internal/examples/showcases/wallet env="CGO_ENABLED=1 TMPDIR=/var/folders/td/0ny4r8md2vg9lz2t2knwr7yr0000gn/T/ Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.RMOJ9UYPA6/Render USER=conanchen ITERM_PROFILE=Default XPC_FLAGS=0x0 XPC_SERVICE_NAME=0 ITERM_SESSION_ID=w1t0p0:D36B5F33-CC1F-46B7-B33F-754303136620 GOOS=darwin GOROOT=/usr/local/Cellar/go/1.13/libexec FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn HTTPS_PROXY=127.0.0.1:1087 HTTP_PROXY=127.0.0.1:1087 PATH=/usr/local/opt/qt/bin:/Users/conanchen/go/bin:/Users/conanchen/Library/flutter/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin TERM_PROGRAM=iTerm.app TERM=xterm-256color LOGNAME=conanchen OLDPWD=/Users/conanchen/go/src TERM_PROGRAM_VERSION=3.3.2 OSTYPE=darwin LC_TERMINAL=iTerm2 GOARCH=amd64 GOPATH=/Users/conanchen/go __CF_USER_TEXT_ENCODING=0x0:25:52 QT_HOMEBREW=true TERM_SESSION_ID=w1t0p0:D36B5F33-CC1F-46B7-B33F-754303136620 SHLVL=1 LC_TERMINAL_VERSION=3.3.2 LDFLAGS=-L/usr/local/opt/qt/lib PWD=/Users/conanchen/go/src/github.com/therecipe/qt/internal/examples LANG=zh_CN.UTF-8 COLORTERM=truecolor SHELL=/bin/bash CPPFLAGS=-I/usr/local/opt/qt/include SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.CbslYBimHQ/Listeners PUB_HOSTEDURL=https://pub.flutter-io.cn HOME=/Users/conanchen COLORFGBG=7;0 =/Users/conanchen/go/bin/qtdeploy GO111MODULE=off" error="exit status 2" name="build for darwin on darwin" github.com/therecipe/qt/internal/examples/showcases/wallet/dashboard github.com/therecipe/qt/internal/examples/showcases/wallet/hosting github.com/therecipe/qt/internal/examples/showcases/wallet/assets
widgets-minimal.cpp:1337:41: warning: 'resolveSymlinks' is deprecated: Use !testOption(DontResolveSymlinks) instead [-Wdeprecated-declarations] /usr/local/Cellar/qt/5.13.1/lib/QtWidgets.framework/Headers/qfiledialog.h:163:5: note: 'resolveSymlinks' has been explicitly marked deprecated here /usr/local/Cellar/qt/5.13.1/lib/QtCore.framework/Headers/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X' /usr/local/Cellar/qt/5.13.1/lib/QtCore.framework/Headers/qcompilerdetection.h:649:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
Undefined symbols for architecture x86_64: "QQmlPrivate::qmlregister(QQmlPrivate::RegistrationType, void*)", referenced from: QGlobalStatic<(anonymous namespace)::Registry, (anonymous namespace)::(anonymous namespace)::Q_QGS_unitRegistry::innerFunction(), (anonymous namespace)::(anonymous namespace)::Q_QGS_unitRegistry::guard>::operator()() in _x004.o "QQmlPrivate::qmlunregister(QQmlPrivate::RegistrationType, unsigned long long)", referenced from: (anonymous namespace)::(anonymous namespace)::Q_QGS_unitRegistry::innerFunction()::Cleanup::~Cleanup() in _x004.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture x86_64: "QQmlPrivate::qmlregister(QQmlPrivate::RegistrationType, void*)", referenced from: QGlobalStatic<(anonymous namespace)::Registry, (anonymous namespace)::(anonymous namespace)::Q_QGS_unitRegistry::innerFunction(), (anonymous namespace)::(anonymous namespace)::Q_QGS_unitRegistry::guard>::operator()() in _x004.o "QQmlPrivate::qmlunregister(QQmlPrivate::RegistrationType, unsigned long long)", referenced from: (anonymous namespace)::(anonymous namespace)::Q_QGS_unitRegistry::innerFunction()::Cleanup::~Cleanup() in _x004.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture x86_64: "QQmlPrivate::qmlregister(QQmlPrivate::RegistrationType, void*)", referenced from: QGlobalStatic<(anonymous namespace)::Registry, (anonymous namespace)::(anonymous namespace)::Q_QGS_unitRegistry::innerFunction(), (anonymous namespace)::(anonymous namespace)::Q_QGS_unitRegistry::guard>::operator()() in _x004.o "QQmlPrivate::qmlunregister(QQmlPrivate::RegistrationType, unsigned long long)", referenced from: (anonymous namespace)::(anonymous namespace)::Q_QGS_unitRegistry::innerFunction()::Cleanup::~Cleanup() in _x004.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
@conanchen sorry, this is probably because these examples where build with
qtdeploy -quickcompiler test desktop
during the test step of the setup.
And if you now build them without the -quickcompiler
flag, things might break.
I wrote a bit about this here: https://github.com/therecipe/qt/issues/278#issuecomment-488170961
To make it work for now, either remove all the rcc*
files or use the -quickcompiler
flag.
I will change the setup so that it won't use the -quickcompiler
flag any longer, and enable it again once I solved the issues I wrote about in the linked comment.
ConandeMacBook-Pro:examples conanchen$ $(go env GOPATH)/bin/qtsetup INFO[0000] running: 'qtsetup prep' INFO[0000] successfully created qtrcc symlink in your PATH (/usr/local/bin/qtrcc) INFO[0000] successfully created qtmoc symlink in your PATH (/usr/local/bin/qtmoc) INFO[0000] successfully created qtminimal symlink in your PATH (/usr/local/bin/qtminimal) INFO[0000] successfully created qtdeploy symlink in your PATH (/usr/local/bin/qtdeploy) INFO[0000] running: 'qtsetup check darwin' [docker=false] [vagrant=false] INFO[0000] GOOS: 'darwin' INFO[0000] GOARCH: 'amd64' INFO[0000] GOVERSION: 'go1.13' INFO[0000] GOROOT: '/usr/local/Cellar/go/1.13/libexec' INFO[0000] GOPATH: '/Users/conanchen/git/therecipe/examples/vendor/github.com/therecipe/qt' INFO[0000] GOBIN: '/Users/conanchen/git/therecipe/examples/vendor/github.com/therecipe/qt/bin' INFO[0000] GOMOD: '/Users/conanchen/git/therecipe/examples/go.mod' INFO[0000] QT_HASH: '5b89e5062c99ac96cf0da217c00ff7d1f442a7eb' INFO[0000] QT_API: '' INFO[0000] QT_VERSION: '5.13.0' INFO[0000] QT_DIR: '/usr/local/opt/qt' INFO[0000] QT_STUB: 'false' INFO[0000] QT_DEBUG: 'false' INFO[0000] QT_QMAKE_DIR: '' INFO[0000] QT_WEBKIT: 'false' INFO[0000] QT_HOMEBREW: 'true' INFO[0000] QT_MACPORTS: 'false' INFO[0000] QT_NIX: 'false' INFO[0000] QT_FELGO: 'false' INFO[0000] XCODE_DIR: '/Applications/Xcode.app' INFO[0000] QT_PKG_CONFIG: 'false' INFO[0000] running: 'qtsetup generate darwin' [docker=false] [vagrant=false] WARN[0000] parser.LoadModule error=EOF module=Gui WARN[0000] parser.LoadModule error=EOF module=QuickControls2
INFO[0019] installing full qt/core INFO[0019] installing full qt/androidextras github.com/therecipe/qt/androidextras
INFO[0019] installing full qt/gui INFO[0019] installing full qt/network INFO[0019] installing full qt/xml
----- and found qt installed sucessfully:
/Users/conanchen/go/pkg/mod/github.com/therecipe/qt@v0.0.0-20190914193131-4c875570321e/webengine /Users/conanchen/go/pkg/mod/github.com/therecipe/qt@v0.0.0-20190925233643-383164b95068/webengine /Users/conanchen/go/pkg/mod/github.com/therecipe/qt@v0.0.0-20190904000911-d6c64b2b9081/webengine /Users/conanchen/go/pkg/mod/github.com/therecipe/qt@v0.0.0-20190924211142-521980c88788/webengine /Users/conanchen/git/therecipe/examples/vendor/github.com/therecipe/qt/webengine find: /dev/fd/3: Not a directory
--------- tried to run example:
ConandeMacBook-Pro:examples conanchen$ qtdeploy -quickcompiler test desktop ./basic/qml WARN[0001] parser.LoadModule error=EOF module=Core WARN[0001] parser.LoadModule error=EOF module=QuickControls2 WARN[0001] parser.LoadModule error=EOF module=Gui WARN[0001] parser.LoadModule error=EOF module=Qml ERRO[0003] failed to run command _func=RunCmd cmd="bash -c /usr/local/bin/go build -p 4 -v -trimpath -o /Users/conanchen/git/therecipe/examples/basic/qml/deploy/darwin/qml_project.app/Contents/MacOS/qml_project -tags=minimal -ldflags=all=\"-w\"" dir=/Users/conanchen/git/therecipe/examples/basic/qml env="PWD=/Users/conanchen/git/therecipe/examples GOPATH=/Users/conanchen/go GO111MODULE=on QT_HOMEBREW=true GOPROXY=https://goproxy.io HOME=/Users/conanchen TERM=xterm-256color TERM_PROGRAM_VERSION=3.3.2 XPC_SERVICE_NAME=0 SHLVL=1 LDFLAGS=-L/usr/local/opt/qt/lib SHELL=/bin/bash TMPDIR=/var/folders/td/0ny4r8md2vg9lz2t2knwr7yr0000gn/T/ QTDIR=/usr/local/opt/qt =/Users/conanchen/go/bin/qtdeploy GOARCH=amd64" error="exit status 2" name="build for darwin on darwin"
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
OK,use GOPATH mode, it works now. refer to https://github.com/therecipe/qt/issues/948
Just for the reference, in case someone else is running into this as well:
./main.go:17:2: undefined: core.QCoreApplication_SetAttribute
This is related to
WARN[0001] parser.LoadModule error=EOF module=Core WARN[0001] parser.LoadModule error=EOF module=QuickControls2
and can be solved by running
go get -v github.com/therecipe/qt/internal/binding/files/docs/5.13.0
(I will update the example repo in the future to get rid of the need to run this though)
some env info
pwd:~/go/src/github.com/therecipe/qt/internal/examples/qml/application
cmd: cat application.go
cmd: qtdeploy -debug test desktop (well, nothing happened)
pwd:~/go/src/github.com/therecipe/qt/internal/examples/qml/application/deploy/darwin/application.app/Contents/MacOS
cmd:
widgets err
pwd: ~/go/src/github.com/therecipe/examples/basic/widgets/deploy/darwin/widgets.app/Contents/MacOS cmd: qtdeploy test desktop
otool -L widgets
also tried:
got err
but ’go run ~/go/src/github.com/therecipe/examples/basic/widgets/main.go‘ works