I am trying to compile a program with a user interface as a .out file. I compiled it just the same way before and I did not edit the code, using this
`pkg-config --cflags --libs gtk+-2.0`
Back in 16.04, the code compiled into an application and I could double click and launch the app. This time, I can't. When I double click, it tries to open with glade and shows an error. For some reason, the compiler or the system thinks the file is supposed to be a shared library. How can I tell it to be an application? I have to execute it in the terminal like a non-gtk compiled C file.
How can I compile it as an app on 18.04?
As of gcc-6.2 gcc in Ubuntu is configured with the --enable-default-pie option, (Position Independent Executable), that's why it's a shared object. (- LSB shared object
The compiler override for this is
-fno-pie
, the linker override is-no-pie
Apparently for an a.out file you only need to apply the linker -no-pie though both options together also work.
Also a factor may be your file manager, some will allow marking & running the shared object as exectubale. Nautilus doesn't anymore.(nemo does