invoker
command instead of executing the executable file.applauncherd
, compile it with -fPIC
option to produce position-independent code. It is recommended that you link them either as shared libraries, or, preferably, as position-independent executables, which can be executed both traditionally and with the launcher. The -pie
and -rdynamic
linker flags accomplish this.
To improve linking and loading times of shared object libraries, it is recommended that you hide any unnecessary symbols from the resulting binary by using -fvisibility=hidden
and -fvisibility-inlines-hidden
flags as well. However, applauncherd
needs to find the entry point for your application, so the symbol main
needs to be explicitly made visible. This can be done as follows:
#include <QtCore/QtGlobal> Q_DECL_EXPORT int main(int argc, char **argv) { ... }
If your application loads a plug-in that needs to access some symbols in the main application, the symbols also need to be exported. In addition, you must use the --global-syms
invoker parameter, as described in Advanced invoker command line parameters.
Normally you do not need to worry about the compiler and linker flags, as the applauncherd-dev
package provides configuration options for qmake
, CMake
, and pkg-config
. If you are building a Debian package, make your package build-depend on applauncherd-dev
and your application binary package depend on applauncherd
.
For details on how to get the compiler and linker flags, see Using qmake, Using CMake, or Using pkg-config.
exit()
, change them to use _exit()
instead. This prevents cleanup actions related to shared libraries to be performed multiple times. For more details, see Limitations and known issues.
invoker --type=q /usr/bin/myApp
/usr/bin/invoker --single-instance --splash=/usr/share/myApp/splash.jpg --type=q /usr/bin/myApp