# Multiple executables in one AppImage which share libs

**URL:** <https://discourse.appimage.org/t/multiple-executables-in-one-appimage-which-share-libs/1093>\
**Category:** Creating AppImages\
**Created:** [February 26, 2019, 9:33pm UTC](https://discourse.appimage.org/t/multiple-executables-in-one-appimage-which-share-libs/1093 "2019-02-26T21:33:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbailey](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@bbailey](https://discourse.appimage.org/u/bbailey)\
**Post date:** [February 26, 2019, 9:33pm UTC](https://discourse.appimage.org/t/multiple-executables-in-one-appimage-which-share-libs/1093/1 "2019-02-26T21:33:54Z")

</div>

I have two applications built with the Qt framework that I’d like to package together. There is a main program that calls a secondary program.

Both programs share some Qt libraries. I currently build the secondary as an appImage then include it in the main appImage. This makes the overall image very large. It would be much smaller if I could build both executables into one image and have them share libraries. I looked at the documentation and I’m not finding any mention of how to do this.

Is this possible?

---

<div class="post-metadata">

**Author:** ![probono](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/probono/32/81_2.png) [@probono](https://discourse.appimage.org/u/probono)\
**Post date:** [March 21, 2019, 8:58pm UTC](https://discourse.appimage.org/t/multiple-executables-in-one-appimage-which-share-libs/1093/2 "2019-03-21T20:58:39Z")

</div>

Yes. Have both applications in the same AppDir, and specify the secondary application (the one that is not being referenced in `Exec=` in the desktop file) to linuxdeployqt like this: `linuxdeployqt -executable=appdir/usr/bin/secondaryapp -appimage`.

---

<div class="post-metadata">

**Author:** ![kid-pc-chen](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/kid-pc-chen/32/230_2.png) [@kid-pc-chen](https://discourse.appimage.org/u/kid-pc-chen)\
**Post date:** [March 26, 2019, 2:59am UTC](https://discourse.appimage.org/t/multiple-executables-in-one-appimage-which-share-libs/1093/3 "2019-03-26T02:59:44Z")

</div>

Hi @probono

My scenario is a bit different to @bbailey 's  
I got a set of command line utilities (written in C++/built with CMake + gcc);  
and these utilities depend on some common shared libraries.

Accroding to the rule “one AppImage file = one application”,  
it seems that it is not possible to package all of the utilities together into one AppImage.  
(even if the bin folder in AppDir is allowed to contain multiple executable.)

One workaround I can image is that I create a launcher and make the launcher to invoke the utilities in AppDir/bin.  
(AppRun points to the launcher).

Is there any suggestion for my scenario?

Thanks.

---

<div class="post-metadata">

**Author:** ![kid-pc-chen](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/kid-pc-chen/32/230_2.png) [@kid-pc-chen](https://discourse.appimage.org/u/kid-pc-chen)\
**Post date:** [March 26, 2019, 3:37am UTC](https://discourse.appimage.org/t/multiple-executables-in-one-appimage-which-share-libs/1093/4 "2019-03-26T03:37:47Z")

</div>

ahha it seems I asked the same question as

> [@Call alternative binary from appimage?](https://discourse.appimage.org/t/call-alternative-binary-from-appimage/93/10):
>
> Check out the new $ARGV0 environment variable that gets exported by the AppImage runtime since [https://github.com/AppImage/AppImageKit/commit/63485edeb854e8e830f201280a61bb803a4ddaa3](https://github.com/AppImage/AppImageKit/commit/63485edeb854e8e830f201280a61bb803a4ddaa3) Example of how this can be used: me@host:~$ ln -s Downloads/ippsample-git.4fbfa3f-x86\_64.AppImage ipptool me@host:~$ ./ipptool Usage: ipptool [options] URI filename [... filenameN] (...) me@host:~$ ln -s Downloads/ippsample-git.4fbfa3f-x86\_64.AppImage ippserver me@host:~$ ./ippserver Usage: ippserver [optio…

---

<div class="post-metadata">

**Author:** ![probono](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/probono/32/81_2.png) [@probono](https://discourse.appimage.org/u/probono)\
**Post date:** [March 27, 2019, 6:43am UTC](https://discourse.appimage.org/t/multiple-executables-in-one-appimage-which-share-libs/1093/5 "2019-03-27T06:43:29Z")

</div>

Yes. Is it working for you?

---

<div class="post-metadata">

**Author:** ![kid-pc-chen](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/kid-pc-chen/32/230_2.png) [@kid-pc-chen](https://discourse.appimage.org/u/kid-pc-chen)\
**Post date:** [March 27, 2019, 6:44am UTC](https://discourse.appimage.org/t/multiple-executables-in-one-appimage-which-share-libs/1093/6 "2019-03-27T06:44:59Z")

</div>

I haven’t try yet. But I thought it should work. Thanks 😀

---

<div class="post-metadata">

**Author:** ![pestophagous](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/pestophagous/32/353_2.png) [@pestophagous](https://discourse.appimage.org/u/pestophagous)\
**Post date:** [April 1, 2020, 11:52pm UTC](https://discourse.appimage.org/t/multiple-executables-in-one-appimage-which-share-libs/1093/7 "2020-04-01T23:52:58Z")

</div>

I landed on this page because it was the Number 1 search result for my query: “linuxdeployqt two executables”

This answer helped me a lot.

But it seems that `-binary` is not the actual name of the option!

I made it work using the option `-executable` instead. Was this command flag renamed at some point? Anyhow, it works 🙂

---

<div class="post-metadata">

**Author:** ![probono](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/probono/32/81_2.png) [@probono](https://discourse.appimage.org/u/probono)\
**Post date:** [April 16, 2020, 7:26pm UTC](https://discourse.appimage.org/t/multiple-executables-in-one-appimage-which-share-libs/1093/8 "2020-04-16T19:26:33Z")

</div>

You are correct. Corrected above.
