Building release to machine without Qt

133 views
Skip to first unread message

Antony Ho

unread,
Dec 10, 2014, 10:21:42 AM12/10/14
to go-...@googlegroups.com
Hi,

I want to release some builds to users, both Ubuntu and Windows. Their machines do not have Qt nor its libraries. Except the QML files being used, what do I have to ship with in order to let users to be able to execute my builds and not requiring installation of Qt?

Thanks!


Antony.H

Gustavo Niemeyer

unread,
Dec 10, 2014, 1:07:42 PM12/10/14
to Antony Ho, go-...@googlegroups.com
I'm afraid the answer will be the same as when linking against Qt via any other language: they'll need the Qt libraries available. For Windows, I'm not sure what is the most elegant installation approach these days for that kind of bundling. For Ubuntu, it's easy to create a package that automatically installs the necessary dependencies, or you can just build your single-binary application, and ask them to install the dependencies with a single apt-get command.

--
You received this message because you are subscribed to the Google Groups "go-qml" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-qml+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ben Campbell

unread,
Dec 10, 2014, 4:22:37 PM12/10/14
to go-...@googlegroups.com

On Thursday, December 11, 2014 4:21:42 AM UTC+13, Antony Ho wrote:
I want to release some builds to users, both Ubuntu and Windows. Their machines do not have Qt nor its libraries. Except the QML files being used, what do I have to ship with in order to let users to be able to execute my builds and not requiring installation of Qt?

On windows, windeployqt is your friend. You give it an executable to scan, and it copies over all the required library files and plugins and other gubbins.
There's also macdeployqt, for osx, which also patches the executable to update the file locations and a few other mac-specific things.

A couple of quirks I found with the windows version:
1) it didn't pick up libwinpthread-1.dll, so I had to copy that over myself.
2) I had to use the --debug flag, which means the _enormous_ debug versions of the QT libraries were used.
3) Qt can also be a bit sensitive to the OpenGL version under windows. There's some minimum OpenGL API version it requires, and some windows machines might require updated graphics drivers to supply it...
(eg my app won't run under the windows I've got installed in a VirtualBox VM, but works fine on the same machine when actually booted into windows)
I really don't know how much of an issue this is out in the real world. You can avoid using the OpenGL-requiring widgets I think, but I couldn't tell you which ones they are.

Under Linux, I guess you could use ldd to try and figure out the shared libraries, but I think there'd be a lot of faffing about trying to figure out all the other bits which are loaded at runtime. strace might help. You might be able to use the output from windeployqt as a cue. (or look for the source of windeployqt/macdeployqt and try and build a linuxdeployqt :-)

But really, I'd probably just check that your most likely target distros have up-to-date QT5 packages, ask your users to make sure they're installed, and be done with it. Or, more ideally, build your own packages with the correct dependencies set, so installation and updating is all handled automatically.

Good luck!



Reply all
Reply to author
Forward
0 new messages