linux-application mime type

when I deploy some application on linux platform I found some application can run
in file manager through double click, but my application can’t. So I do some research.

short answer:

app has mime type:

  • application/x-executable
  • application/x-sharedlib

that x-executable file manager recognize it you can double click to run it.
but x-sharedlib has some security advantage, so x-sharedlib is recommended

long answer

you can use file --mime-type app see app’s mime type, also file app is working too.

gcc now defaults to building with PIE (Position Independent Executable) enabled on x86 Debian systems for security reasons.
The behavior is occurring because newer ubuntu distros set GCC default link flag -pie,
which marks e_type as ET_DYN on the binary file. Consequently, the Operating System recognizes as Shared Library.

-pie allows for some extra security protections that are fundamentally incompatible with -no-pie.

Qt project:
QMAKE_LFLAGS += -no-pie