Nate R
Nate R

Reputation: 13

How can I deploy Qt applications to other systems?

I'm new to C++ and Qt but I've managed to make a simple test program and I was wondering how can I deploy it to other operating systems? Right now I'm on a Mac so how can I make it run on my PC? I've tried to find some answers but the only answers I've seen is how to deploy them already on Windows. Thanks for the help.

Upvotes: 1

Views: 1174

Answers (4)

cyco130
cyco130

Reputation: 4934

I use Qt SDK under wine to cross-compile my programs for Windows from Linux.

qmake uses target specifications, i.e. "mkspec"s as they call them. So, in theory, it should be possible to use cross-compilers. But unfortunately all my attempts at using mingw cross-compiler with a custom mkspec have failed. I managed to compile an application but the resulting .exe did not run. There are just too many things to do right that you'll always miss one or two.

As others have pointed, probably the easiest way is to install Qt SDK to the target machine, or to wine if Windows is your only concern, and do the compilation there.

Upvotes: 0

Macke
Macke

Reputation: 25680

Easiest way is to run Windows somehow and compile & build a distribution there. You can use a virtual machine (VMWare/Parallells, slow) or dual-boot (faster), or a separate windows PC altogether.

A VM is a good thing to have anyhow when you want to test your deployment, as it's easy to wipe the machine and re-run the installation.

By using Qt's qmake, you'll get the build done easily enough on other OS:es (or use Qt Creator).

There's also the option of using the CMake/CPack tools instead, as these give you build-anywhere files, as well as multi-platform packaging with a single config file.

Upvotes: 1

Nicholas Smith
Nicholas Smith

Reputation: 11754

You can do it with cross compilers, but in my experience it's far, far easier to just build it on the target platform, as that way you can test the application within Qt to make sure there's no twitchiness. Cross-platform doesn't always means perfect across platforms.

Upvotes: 0

Hot Licks
Hot Licks

Reputation: 47699

Well, you need a compiler that targets the architecture you'll run on. Then you need to install the Qt libraries on the target machine. Then you can install and run a compiled Qt module.

There are a handful of loaders out there than handle the (conditional) library install, based on what your app needs. Don't offhand have a reference. But the guys at Qt Centre Forum probably can give you some more info.

(Keep in mind that C++/Qt is not Java -- no bytecodes -- it needs to be compiled for each different architecture where you want it to run.)

Upvotes: 1

Related Questions