User forums > Help
C::B creates a shared lib instead of an app under Kubuntu
PeterP:
--- Quote from: cacb on August 30, 2017, 02:45:02 pm ---I saw a similar problem after installing Kubuntu 17.04. I don't think it is caused by Code::Blocks, but gcc.
Check if you can run your application from a terminal, it should start just fine. Then if you are unable to run the same program by clicking on it in Dolphin, you are most likely looking at this problem:
GCC compiles programs to shared object instead of executable, preventing GUI file managers from executing programs
https://bugs.launchpad.net/ubuntu/+source/shared-mime-info/+bug/1639531
--- End quote ---
yes, exactly the problem I encounter...
so this is the wrong forum for this... :D
but maybe you know a solution ???
thanks
cacb:
--- Quote from: PeterP on August 30, 2017, 03:17:48 pm ---but maybe you know a solution ???
--- End quote ---
First of all it is not unique to Kubuntu or KDE, but any Linux desktop I think. The problem is that gcc generates PIE (Position Independent Executable) code, which the file browsers believe is shared object files, and therefore they will not run them when a user clicks on the file. It looks like nobody takes responsibility to solve this annoying problem. But I did implement my own work-around. I created a file
--- Code: ---~/.local/share/applications/RunExec.desktop
--- End code ---
With the contents:
--- Code: ---[Desktop Entry]
Exec=%f
MimeType=application/x-sharedlib;
Name=RunExec
NoDisplay=true
Type=Application
--- End code ---
Essentially it fools KDE to run the program when clicking on it, even if it thinks it is a shared library. Now, if it really is a shared library, you will get an error which is fine.
Once they get this issue sorted out, we should just delete ~/.local/share/applications/RunExec.desktop
PeterP:
thanks cabc !!!
works like a charm !!! :)
I hope they'll get it sorted out... :D
it's still strange to run a "shared lib" that actually is an application !!! ::)
Navigation
[0] Message Index
[*] Previous page
Go to full version