Linking problems on FreeBSD

Alexander Neundorf neundorf at kde.org
Sun Feb 10 23:29:46 CET 2008


On Sunday 10 February 2008, Andreas Pakulat wrote:
> On 10.02.08 13:45:10, David Johnson wrote:
> > We are still having linking problems over at FreeBSD. Several libraries
> > and apps are being linked to KDE3 by mistake. I need to find a way to fix
> > this. Please help me if you can.
> >
> > The problem arises because KDE3 is installed to /usr/local, along with
> > x11 and Qt4. KDE4 is being installed to /usr/local/kde4. I have fixed the
> > include path order, but I can find no way to fix the library order so
> > that /usr/local/kde4/lib will always come before /usr/local/lib. How
> > cmake generates the library link order is a mystery to me.

It determines the correct order so that all the correct libraries will be 
used.
Apparently this doesn't work if the dependent libraries are determined that 
way as we do it, i.e. directly using the output of 
export_library_dependencies(), since this doesn't list the full path to 
in-project libs.
CMake cvs has a better way to do that, but that doesn't help us (since we 
won't require cmake 2.6.0).
It almost seems I'll have find some special solution...

Are you actually using cmake 2.4.x or cmake cvs ?

> > An example is kdm_filesystem.so. It's CMakeLists.txt has:
> >
> > target_link_libraries(kcm_filetypes  ${KDE4_KDE3SUPPORT_LIBS} )
> >
> > In FindKDE4Internal.cmake, KDE4_KDE3SUPPORT_LIBS is set to:
> >
> > ${kde3support_LIB_DEPENDS}  ${KDE4_KDE3SUPPORT_LIBRARY}
> >
> > And in the autogenerated KDELibsDependencies.cmake,
> > kde3support_LIB_DEPENDS is set to:
> >
> > "/usr/local/lib/libQtCore.so;-lpthread;kdecore;kdeui;kio;kparts;/usr/loca
> >l/lib/libQtCore.so;-lpthread;kdecore;kpty;/usr/local/lib/libQtXml.so;/usr/
> >local/lib/libQt3Support.so;/usr/local/lib/libQtCore.so;-lpthread;kdecore;k
> >deui;kio;kfile;"
> >
> > With the above entries, the resulting kcm_filesystems.so has dependencies
> > on KDE3 libraries. If it were just this one file, then I could write a
> > single patch to fix it. But this is happening with lots of files, both
> > libraries and executables.
> >
> > What do I do to ensure that the KDE4 libraries (-L/usr/local/kde4/libs)
> > comes before the KDE3 libraries (-L/usr/local/lib)? Please provide me an
> > answer if you are able. I am rapidly losing my patience with cmake.
>
> How does the actual linker call look like? (make VERBOSE=1)
>
> Can you check wether link_directories(${KDE4_LIB_DIR}) helps? Thats

Yes, put that in the top level CMakeLists.txt.

Alex


More information about the Kde-buildsystem mailing list