I have made a qt application.
What is the easiest way to give it to someone else ? If I just give the executable, it doesn't bundle the required dependencies (for example, I get: error while loading shared libraries: libQt5XmlPatterns.so.5: cannot open shared object file: No such file or directory).
Is there an easy tool to bundle the required libraries, or to make use of the package management system (that is to say, a tool that would automatically make a .deb out of the executable) ?
You may create a static build and embed Qt libraries for your specific platform.
Build Standalone Qt Application for Windows
Deploying Qt Applications Linux
Related
I developed a QT application on ubunty linux. I want to include dependencies in my deployed file so that my application can works in any other machine running with ubuntu.
The best way to achieve this is to distribute your application as a .dpkg so the dependencies can be automatically installed. Including dependencies in the binary is tricky and generally means statically compiling libraries instead of dynamically linking them but even then you run into problems.
I have simple Qt program. I have figured out how to use macdeployqt for deploying my app on macbooks without qt installed. But after installation from dmg (it is created using macdeployqt with -dmg option) no resources are displayed.
I added resources to project like this
It displays correctly if I simply put the app bundle from build to my program folder, but it is missing after deploying. What have I done wrong?
I downloaded Qt 5.4 and created Qt Quick application with Qt Quick Controls 1.3.
I didn't change anything in code, just built it (as release). Then I copied .exe to another folder, added all the .dll files I needed and when I launched my program there was no window, just the program process running in the Task manager.
However, I can launch program which uses QtQuick 1.1.
How can I fix it?
Thanks.
Here is an image for some more explanation:
Try to deploy your application using The Windows Deployment Tool which copies all DLL and other files necessary for deployment alongside your application executable automatically.
The Windows Deployment Tool could be found in QTDIR/bin/windeployqt.exe
Open your command prompt and add the path to your Qt directory and it's bin folder to the PATH variable like :
set PATH= path\to\Qt\bin
Next run the windows deployment tool with your application path as the argument:
windeployqt.exe <path-to-app-binary>
This way you make sure that the deployed application would work on any computer and you have included whatever necessary.
Sounds like you are missing the platform plugin. It should be in the folder of the executable, in a platforms subfolder. That's why you aren't getting a window - the runtime fails to load the platform support plugin. On windows that should be a qwindows.dll file.
I just have a little question about running Qt created apps on different operating systems.
As a normal user do i have to install Qt framework to run Qt apps ?
I mean i've created Qt app using Windows , then i made a build for Linux .
Do i need to install the Qt framework on the Linux pc inorder to run that app ?
Or there is a way to package all the needed libraries into the app installer .
Best Regards
You can deliver the dynamic libs you need with your application, as it's described here:
http://doc.qt.io/qt-5/deployment.html
Since Qt is not a system library, it has to be redistributed along
with your application; the minimum is to redistribute the run-time of
the libraries used by the application. Using static linking, however,
the Qt run-time is compiled into the executable.
Depends what you mean by 'framework', you will need the runtime libraries, unless you paid Nokia for a license to allow static linking.
For Linux, I think you would generally ensure that the Qt packages have been installed during installation (i.e. make them a requirement of the package you provide). Under Mac OS you would need to package the .so (shared objects) with your application. Under Windows you do the same (provide the .dlls) and install them with the application (not in the system folders).
The issue with static linking that #cbamber85 is alluding to, is the conformance with the LGPL licence where it's legal to link to the libraries at runtime but not at compile time (i.e. use the .so/.dll but not the .a files).
In Qt when I build a project it creates the executable but it doesn't include the necessary DLLs. Is their some option I can turn on to do this for me?
I'll assume you are referring to deploying your application. If you build with static linking to Qt, you won't have to distribute Qt DLLs but you will have a large executable. You may have to compile the Qt library yourself to get static libraries.
Dynamic linking will require you to copy the appropriate Qt DLLs with your application. Some build environments may have an option to help with this. If you mention what your development tool chain and platform is in the question, somebody may be able to help with specifics.
Qt has some documentation related to deployment here.