Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt Program deploy to multi platform, how?

Am new in Qt Programming and i would like to develop a program which i want to run in Windows, Linux(ubuntu), and Mac.

I heard that Qt support mutli-platform application development,

but my Question is that,

would any Qt library need to run these appilication in Ubuntu after i deployed or compiled?

like image 361
coderex Avatar asked Mar 09 '10 07:03

coderex


People also ask

Is Qt multi platform?

Qt is a cross-platform software development framework for desktop, embedded, and mobile platforms.

Are Qt apps cross-platform?

Qt (pronounced "cute") is cross-platform software for creating graphical user interfaces as well as cross-platform applications that run on various software and hardware platforms such as Linux, Windows, macOS, Android or embedded systems with little or no change in the underlying codebase while still being a native ...

How do I distribute the Qt application in Windows?

The recommended way to deploy your application is to use the official deployment tool (windeployqt). If you have installed the toolkit for Android ARMv7, there will be a folder named android_armv7. The file windeployqt.exe would be located in C:\Qt\5.9. 9\android_armv7\bin.


1 Answers

If you deploy on Ubuntu, and therefore use a .deb package, then your job is easy since you just have to require qt as a dependency and apt will automatically install it as needed.

Windows and Mac however do not have any "good" software management layer, so you have no choice but include the required Qt DLLs with your binary or compile a static one. On Windows you just have to make sure the DLLs are in the same directory as your program. Mac however requires some relinking to be done. This is a big pain, but fortunately Qt comes with a tool named macdeployqt which does this for you.

So according to my experience, Linux is the easiest platform to deploy to, followed by Windows, and Mac is a good last.

The link to the Qt deployment doc given above is a good starting point. If you need an example, I have written a couple of scripts to build the Windows binaries of a program of mine. You can have a look at these to get started.

Windows installer:
http://gitorious.org/tagaini-jisho/tagaini-jisho/blobs/master/pack/win32-cross/buildwin32releases.sh
http://gitorious.org/tagaini-jisho/tagaini-jisho/blobs/master/pack/win32-cross/tagainijisho.nsi

like image 153
Gnurou Avatar answered Sep 18 '22 00:09

Gnurou