C and C++ are powerful programing languages that allow producing almost any kind of app. Building an AppImage from a C/C++ app is all about resolving all the dependencies. You can use the dependencies or package management system your prefer and even mix them. The only requirement is that all the shared libraries must be reachable to the linker when the AppImage build tool is executed.

In this case linuxdeploy will be used to create the AppImage file. This tool takes as input and AppDir. There we will install all the application dependencies using conan.

You can find the whole template here

Building the AppDir

To create the AppDir we will use the install method of your preferred build system. But instead of using /usr as target dir, we will install our binaries to AppDir like in the following examples:


DESTDIR=AppDir make install


./configure --prefix=/usr
DESTDIR=AppDir make install


qmake PREFIX=/usr .
INSTALL_ROOT=AppDir make install

Once your binaries are installed, the AppDir folder should look like this:


Notice that installing a desktop file and an icon is mandatory.

At this point if your applications doesn’t use any kind of plugins systems where shared libraries are loaded at run-time you can proceed to running linuxdeploy. If on the contrary your app require special plugins please read the “Including plugins” section.

Including plugins

If your app uses any kind of plugin system you must be sure that it’s capable to locate them using paths relative to the main binary location. And also manually include them in the right location inside the AppDir. Once done you can proceed to run linuxdeploy.

Generating the AppImage

Once you have an AppDir created you can proceed call linuxdeploy this way:

linuxdeploy --appdir=AppDir --output appimage

and you will get a nice AppImage file.

Build pipeline

## AppImage
  # old enough base system with conan pre-installed 
  image: conanio/gcc48:1.14.3
  stage: build
    # Upgrade Conan version
    - sudo pip install --upgrade conan
    # Automatic detection of your arch, compiler, etc.
    - conan user
    # Add AppImage specific repositories
    - conan remote add appimage-conan-community --insert=0
    # Prepare build environment
    - conan install .

    # enter conan virtual environment
    - .
    - cmake -DCMAKE_INSTALL_PREFIX=/usr
    # Create AppDir
    - DESTDIR=AppDir make install
    # Create AppImage
    - linuxdeploy --appdir=AppDir --output appimage --desktop-file=AppDir/usr/share/applications/net.azubieta.cpp_appimage_template.desktop
    # exit conan virtual environment
    - .

      - cpp_appimage_template*.AppImage*


Once the build is done you can find the resulting file in the jobs artifacts view.

You may also want to get a reference to the latest produced artifact in order to show it in your applications site downloads page or in the pling product page. Use the following snippet to get your own download link address:

"<user name>/<project name>/-/jobs/artifacts/master/raw/<artifact file path>?job=<job name>"

Be sure to replace the user name, project name, artifact file path, and job name.