Bogdan
Bogdan

Reputation: 608

build c++ (qt) program as one portable file with built-in dependences

I have a Qt project. I can build it but I have to keep all external files near with the executable one if I want to use the exe-file as portable program. But a customer wants it to be an one executable without any other files. The size of result file does not matter.

So, if I would use Python, I could do it like this:

[localhost@localhost ~]$ pyinstaller --onefile myscript.py

Can I do the same using Qt (with MinGW)?

Upvotes: 0

Views: 496

Answers (3)

Frederik De Ruyck
Frederik De Ruyck

Reputation: 536

You can't unless you have a commercial Qt license or if you don't link to any of the Qt libraries (you could still use Qt creator and qmake).

Upvotes: 0

Botje
Botje

Reputation: 30807

You could package your bundle into a self-extracting ZIP that automatically runs and cleans up after itself. I found this answer that gets you close.

Upvotes: 0

Benjamin Bihler
Benjamin Bihler

Reputation: 2009

It depends on the files you are talking about. With static linking you can get rid of dll files and by using Qt resource collection files you can for example link pictures and html files into your executable.

Upvotes: 1

Related Questions