Unsolved How can make .exe file in qt5 for windows and linux?
-
@SGaist Thanks for your reply! How I can make .exe on Linux?
-
@SGaist If I will set up a virtual machine on windows os and try the application developed on ubuntu is it your means?
-
@Mijaz said in How can make .exe file in qt5 for windows and linux?:
If I will set up a virtual machine on windows os and try the application developed on ubuntu is it your means?
You set up a virtual machine with Windows, install Qt and a compiler there and build your app for Windows there.
This is way easier than setting up a cross compile environment on Linux to build for Windows. -
@jsulm Is generated .exe on windows using VMWARE will run always without starting VMWARE? Is it possible?
-
@Mijaz said in How can make .exe file in qt5 for windows and linux?:
Is generated .exe on windows using VMWARE will run always without starting VMWARE?
Of course. It does not matter whether you run an OS like Windows in a virtual machine or not. That is the whole point of virtualization.
-
@jsulm Thanks! But if I need to cross-compiled then what I should have to do for compilation? Kindly give your best remarks on the cross compilation?
-
@Mijaz I never cross compiled from Linux to Windows. You should check MinGW documentation if you really want to to go this route (I again want to point out that setting up a virtual machine with Windows is WAY easier than setting up a cross compile environment).
-
You can set up a VM and compile and build it on windows then just take out that .exe file in your build directory and put it in an empty folder then open those compiler-command prompt stuff(i'm new so i dont know what they're called)
and type in windeployqt your_exe_filename.exe, it will build it, that's how i do mine, if your app uses QML then u write windeployqt --qmldir your_exe_name.exe
-
Qt is not Java. Java is built once and can be run everywhere. For Qt, you use the same code, but have to build your apps on different platforms(Windows, Linux, MacOS) separately to make the executables.
-
I'll deviate a bit from consensus above: use a hosted CI environment.
Even for closed sources, GitHub now offers Actions for free that is able to build, test and create release packages for every platform.
It's soooooooooo much easier than setting up and maintaining your VMs.Alternatives: