Linking error ? Reduced link interface now active

Alexander Neundorf neundorf at
Mon Jul 28 23:43:14 BST 2008

Hi all,

since today the reduced link interface (mainly) for kdelibs is active (as 
discussed on kde-buildsystem since April or so)

What does that mean ?

Until now, if you linked a library A against other libraries B, C and D using 
TARGET_LINK_LIBRARIES(), and you then linked application foo against library 
A, the libraries B, C and D were added automatically to the link command by 
In general this is necessary for static libs, but in KDE we don't really 
support static libs and (mostly) packagers didn't like that behaviour, since 
it creates more dependencies for packets.
So this is now disabled.

This means if you link application foo now against library A, then B, C and D 
won't be added automatically anymore. This means if foo uses symbols from 
library C, you now get undefined references when linking, since C is not 
linked automatically anymore. To fix that you have to add library C to the 

If there is a library bar which always requires that you link to an additional 
library blub, this can still be done, by setting the target 

set_target_properties(bar PROPERTIES LINK_INTERFACE_LIBRARIES blub)

You can see this e.g. in kdelibs/kdecore/CMakeLists.txt for the kdecore 

We (i.e. Dirk) tried to fix all linking problems caused by this change in the 
last days, but probably in some configurations there will still be some 
linker problems. Hopefully you now have an idea what caused them and how to 
fix it :-)
Otherwise, let us know on k-c-d or better kde-buildsystem

>> Visit to unsubscribe <<

More information about the kde-core-devel mailing list