PDA

View Full Version : Making Standalone Application



harvey_slash
22nd September 2013, 11:05
For my first application, I decided to make a calculator is Qt.(I downloaded qt yesterday).
I want to know the process of making that exe into a standalone executable file.
It RUNS fine, but after building, it shows many dlls are missing.
I read about static library etc. but I didn't understand how to use it.
also , I have not downloaded anything apart from the windows 32bit qt(666mb).
thanks in advance.

amleto
22nd September 2013, 11:25
Do more reading on how to make a static build of qt. please be aware that binaries you build are practically* only useable for yourself - you are not allowed to distribute the apps you build like that to other people unless you pay for a commercial Qt license.

*there are caveats, but I don't think there is much point in bringing them up here.

Do you REALLY want to know how to make a single-file executable, or do you just want to know how to make an 'installable program'?

harvey_slash
22nd September 2013, 11:48
I read static qt.
I didn't understand.

and yes, I want to know how to make a single file exe.
(tell me what other ways are there to distribute too).

ChrisW67
22nd September 2013, 21:49
The other, more usual way, is to distribute a dynamically linked application (bundled in an installer as needed). This is described on the same deployment page in the Qt docs as a static build. A dynamic build and deployment is all that is possible with the out-of-the-box Qt binaries anyway. IMHO it is also the easiest way to deploy a Qt application.

You can distribute a statically linked Qt application under the any of the Qt licences but you must meet the requirements of the licence you are using Qt under.

amleto
22nd September 2013, 23:30
I read static qt.
I didn't understand.

and yes, I want to know how to make a single file exe.
(tell me what other ways are there to distribute too).

please answer this question: Do you intend in distributing the program(s) you build into a single exe?

kamre
23rd September 2013, 12:08
please be aware that binaries you build are practically* only useable for yourself - you are not allowed to distribute the apps you build like that to other people unless you pay for a commercial Qt license
Are you kidding? Why it is not possible to distribute a statically linked program that is licensed under (L)GPL for example?

ChrisW67
23rd September 2013, 21:30
With static linking it is impossible with the GPL, and just impractical with the LGPL, if you want to keep your source code closed. If you are willing to distribute source for your program/library under the GPL or LGPL then there is no issue.

anda_skoa
24th September 2013, 08:34
It is best not to be distracted with the type of linking when considering licensing, none of the involved licenses make a distinction for that.

When using a library, any library, you are obligated to fullfil its license conditions. Unless these conditions contain explicit wording regarding to types of linking, they apply to all forms of incorporation, whether it is copying code into the application, dynamically or statically linking with a modified or unmodified library.

If we look at the licenses at hand, the primary focus of each license's condition is:
- GPL: ensure unrestricted usage, ensure access to application sources
- LGPL: ensure unrestricted usage, ensure modifyability of the LGPL part of the final software
- commerical: ensure sustained income for development, limit code distribution requirements

Cheers,
_

amleto
25th September 2013, 01:09
ensure modifyability of the LGPL part of the final software
That is significantly more difficult with a single binary (static linking) if you don't want to disclose your own source, so I think it is worthwhile being 'distracted' by linking decisions and their impact.

andre_teprom
29th September 2013, 14:56
Do you REALLY want to know how to make a single-file executable, or do you just want to know how to make an 'installable program'?

I know this properly don´t answer the raised question, but personally I prefer the 2nd option ( create a single .exe installer file ).
This way, further maintenance, upgrade and error debugging due to different Windows version, becomes easiest.

I already used the INNO SETUP, a freeware amazing tool.

+++