Deploy Qt to Windows on a Linux machine - qt

Feels like a silly question, but I'm struggling to find the answer online: Is it possible to deploy Qt apps to Windows if you did development on a Linux machine? It seems the answer should be "yes", but I can't seem to use windeployqt on my linux machine.
If it is possible, what additional resources do I need to do this?

Yes, it's of course possible.
You have to cross-compile Qt using the MinGW compiler, targeting Windows.
You'll have to patch and build windeployqt yourself. By default, windeployqt is looking for g++.exe in the path. Of course this makes no sense on a linux build host, so you'd have to tweak it so that it finds the correct compiler and runtime libraries.
You can then build your application using the cross-targeted Qt build, and deploy all the necessary artifacts into some deploy folder using windeployqt.
To package the deployed build, you can run nsis or wix on Linux as well, to obtain a Windows installer. You can even sign the executable files (required these days for Windows), there's an open source tool called osslsigncode - it works on most platforms and doesn't require Windows.
It'll take a bit of time for you to figure it all out. It's certainly easiest to just build on Windows and not mess with it. But if you insist on building on Linux - you certainly can.

Related

An installer for Qt apps

I've created a Qt calculator app using Qt Creator 3.6.0 purely in C++ code (I didn't use Designer)
I would like to know how to use Qt to make it installable for publishing.
I ran the app in both Release and Debug modes and have both folders of the two.
I also downloaded and installed Qt Installer Framework Opensource 2.0.1 for my Qt Creator 3.6.0 (the IDE I use for Qt).
And I also have the .dll files needed to run the .exe file.
I've searched the Web for it. But since I'm a novice in Qt I can't do the works properly, or I don't understand. (They seem complicated)
Now, is there any straight forward method to use an installer for the app to make as platform independent as possible?
If so, what installer? And how to do the process? This is the first time for me.

How To Deploy Qt MinGW application for windows

I have develop an application by using QT/ MinGW 32 bit.This app work on my pc Windows 8. But ı want to deploy this app to my friends whose computers has windows 7. How to deploy it.Is there a necessary programs,framework to work it like .net framework, C++ runtime etc.. I don't know.I can't find a clear solution
To deploy a Qt app on Windows, you'll need to gather files from a few different locations. Here is an example how to do it.
See http://doc.qt.io/qt-5/windows-deployment.html, section "Creating the Application Package". You just have to copy all the necessary DLLs (and other files in case of Qt Quick) to the same directory as executable file. The best way to test whether you have all the required files is to rename your Qt installation directory (C:\Qt) to something else and try to double-click your executable.
Deployment on Windows 7 is no different from Windows 8.

How can I use buildroot for my development machine in addition to my target?

I am developing a for an embedded target using buildroot, adding our custom applications as new packages.
These packages depend on some non standard libraries(which we already integrated into buildroot) that are painful to install natively on the development workstations. Can I use buildroot out-of-tree builds to compile the applications for my development machines to test them as well? Assuming all the libraries are in place, they are generic linux applications that should not have problem running on PCs.
Is there a more convenient way to manage both builds?
The only supported way is to use a "crosscompiler" for your host system.
See buildroot environment with host toolchain

Qt and Qt application prerequisites

I am new to Qt, and I am working in Windows 7.
When I try to run my application directly, I see an error about missing some DLLs. I tried to fix them, but I could not (I tried to build statically).
Is there any correct solution?
My question is:
If I want to run my Qt application on other computers, what do I need? For example, for a .NET application we need to install the .NET framework on the target computer, but what about for Qt?
I searched for its SDK and found a SDK that was about 1.6 GB! Does this mean every time I want to install my application I should install a 1.6 GB sized SDK? That's far too bad.
Thanks.
You have to distribute your application with needed libraries.
If your application is running on Windows you can follow this guide: Deploying an Application on Windows. You can find needed libraries as dll in bin directory inside SDK. A basic Qt gui application needs at least QTCORE4.DLL, QTGUI4.DLL and, if you are using Qt Creator, MINGWM10.DLL. You can leave these libraries in the same directory as you application.
You can't link statically against Qt unless you have built the libraries in that configuration (which you won't if you've just downloaded the pre-built SDK). Be aware that if you do want to link statically there are licensing implications for some components.
If you have built a release configuration then you will need at least the libraries Alessandro mentioned, QtCore4.dll and QtGui4.dll. Depending on the other parts of the library you're using you may also need QtXml4.dll QtWebkit4.dll, QtXmlPatterns4.dll and possibly Phonon.dll. Check that you are building a release configuration rather than a debug configuration, as this won't run as it needs the Visual Studio debug runtimes, which you can't redistribute. If you are in doubt which dlls you need then use DependencyWalker to find out (note that this doesn't show Phonon.dll as it is loaded later).
Generally you'll only need about 4-6 of the dlls, you won't need the whole SDK.
Please consider that many applications use Qt, you have some real chance the DLLs are already installed. Anyway, beware of MSVC dependencies: we had some real nightmare deploying applications on some server, partly related to a policy switch from VS2005 to VS2008. Alessandro already given a good resource: see also this previous post.
If you're working with Qt5, besides the .dlls mentioned by the first answer, you must also add the platforms/ folder from the bin directory inside the SDK.

64bit compilation of asp.net dllls

We are having one problem while compiling with 64bit dlls. We are having lots of classlibray in our project and one webapplication. and when comiple it with x64 plateform with 32 bit operating system its compiling but when we move that thing into production environment which is 64bit operating system then its giviing error that one of assambly is not able to load. Can any one have any idea for that? All the class library is also on comipleted x64 option.
I don't really understand your question, so this is not really an answer, but I think it's worth mentioning.
Depending on what you are doing, some COM libraries and third-party Assemblies will require you to run on WOW64. Try doing a fresh rebuild of all the components in your project, and instead of compiling for "Any CPU" compile for "x86" and deploy that. This should force your assembly to run in 32-bit mode on WOW64, and therefore may make your third-party libraries happy.

Resources