kcrash when started from terminal

Sune Vuorela nospam at vuorela.dk
Fri Sep 25 05:35:52 UTC 2015


On 2015-09-24, Harald Sitter <sitter at kde.org> wrote:
> Uh, ah, but, CMake is too smart :P
> If you add a target_link_library that isn't actually used it won't be
> linked. So what every application would have to do is add the target

It is not cmake that is too smart, but the linker when passed
--as-needed (which many distributions does)

$ cat foo.cpp 
int main(int, char**) { };

$ g++ -lQt5Core foo.cpp
$ objdump -x a.out | grep Qt5Core
  NEEDED               libQt5Core.so.5

$ g++ -Wl,--as-needed -lQt5Core foo.cpp
$ objdump -x a.out | grep Qt5Core


But bottom line, just adding some extra linkage doesn't get kept for
many compiled versions.


/Sune



More information about the Kde-frameworks-devel mailing list