I have an application that I built using Qt Creator on Linux and want to deploy it now. However, I don't want to statically build it as I don't want it to be open-sourced. I tried the ldd ./YourExecutable
command, however that only lists (and not add) the additional dependencies the application needs in order for it to run. My question is, how do I gather the necessary dependencies without having to individually look for these files? Is there a tool, such as windeployqt.exe on Windows, that I can use on Linux for the same purpose? Or is there a better approach than the one I'm thinking of?

- 43
- 1
- 9
-
So, you want to compile it in a way that other people will not be able to read it without decompiling it? – Jul 14 '16 at 22:07
-
Yes. On Windows, I'm able to create a folder, put the executable in it, and add all the necessary dependencies and files in order to make the executable work and have the folder be that as a release. I'm trying to do the same on Linux. – xcyl40 Jul 14 '16 at 22:11
-
Would it work to have a tool that installs on Windows but compiles and links for Linux? – Jul 14 '16 at 22:14
-
That could work too, however I'm not familiar with any tools that do this exact purpose? – xcyl40 Jul 14 '16 at 22:17
-
I recommend you do more research before asking a question. This answer was easy to find:) – Jul 14 '16 at 22:27
2 Answers
- Get Cygwin setup.exe: http://www.cygwin.com/
1.1. Run setup.exe and continue to package selection list.
1.2. Under Devel catagory select tools you need for compiling your source. For example 'GNU make'.
1.3. Finish installing.
Get linux crosscompilers for cygwin: "cygwin-gcc-linux.tar.bz2" (68.2 Mb). md5sum: 340e91a346f5bb17e660db10e43005b8
These compilers are made with crosstool 0.28-rc37. This package contains: gcc-3.3.4 and gcc-2.95.3 for i386 (glibc 2.1.3) and gcc-3.3.3 for amd64 (glibc 2.3.2).
Note! There is now newer version of GCC avaible with glibc 2.3.2: "cygwin-gcc-3.3.6-glibc-2.3.2-linux.tar.bz2 (i386, x86_64)".
2.1. Copy 'cygwin-gcc-linux.tar.bz2' to 'c:\cygwin' or install directory which you selected in setup.exe.
2.2. Open Cygwin shell and change directory to root with 'cd /'.
2.3. Uncompress to Cygwin root with command: 'tar -jxvf cygwin-gcc-linux.tar.bz2'.
Cross-compilers are installed under '/opt/crosstool'. You can use theim directly or with commands: gcc-linux, g++-linux, gcc-linux-2.95, g++-linux-2.95, gcc-linux-x86_64 and g++-linux-x86_64.
From: Cross-compiling on Windows for Linux More info here.

- 1
- 1
It sounds like you want to use the shared library deployment option:
http://doc.qt.io/qt-5/linux-deployment.html#creating-the-application-package
Then if you wanted to go further than that, you could look into making a .rpm or a .deb .
There are lots of examples of qt projects that are now available on GitHub and have packages made. Usually for prebuilt binaries you need to make one for x86 and a separate one for x64.
Hope that helps.

- 18,472
- 5
- 61
- 80