Ubuntu recognizes executable as shared library and won't run it by clicking Ubuntu recognizes executable as shared library and won't run it by clicking linux linux

Ubuntu recognizes executable as shared library and won't run it by clicking


I have fixed this behavior by adding the following line on my project's .pro file in QT:

QMAKE_LFLAGS += -no-pie

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.

To work around it, it may be necessary to add -no-pie on compiler option.


What does "file APP_release" say on the command line. The "file" program should say what the system thinks the file is. Executables have "...LSB executable" and shared libraries "...LSB shared object". If it says it is an executable then it appears to be a bug in Ubuntu. If it says it is a shared object then your make log suggests it is a bug in the linker!