Linking problems on FreeBSD

Andreas Pakulat apaku at gmx.de
Mon Feb 11 01:12:15 CET 2008


On 10.02.08 15:55:43, David Johnson wrote:
> On Sunday 10 February 2008, Andreas Pakulat wrote:
> > On 10.02.08 13:45:10, David Johnson wrote:
> > > 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)
> 
> Here an example before any fixes:
> 
> Linking CXX shared module ../../../../lib/kcm_filetypes.so
> cd
> /usr/ports/x11/kdebase4/work/kdebase-4.0.1/build/apps/konqueror/settings/filetypes
> && /usr/local/bin/cmake -P
> CMakeFiles/kcm_filetypes.dir/cmake_clean_target.cmake
> cd
> /usr/ports/x11/kdebase4/work/kdebase-4.0.1/build/apps/konqueror/settings/filetypes
> && /usr/local/bin/cmake -E cmake_link_script
> CMakeFiles/kcm_filetypes.dir/link.txt --verbose=1
> /usr/bin/c++  -fPIC -O2 -pipe -march=pentium4 -Woverloaded-virtual -g -O2
> -fno-reorder-blocks -fno-schedule-insns -fno-inline  -lc -shared
> -Wl,-soname,kcm_filetypes.so -o ../../../../lib/kcm_filetypes.so
> "CMakeFiles/kcm_filetypes.dir/kcm_filetypes_automoc.o"
> "CMakeFiles/kcm_filetypes.dir/filetypesview.o"
> "CMakeFiles/kcm_filetypes.dir/filetypedetails.o"
> "CMakeFiles/kcm_filetypes.dir/filegroupdetails.o"
> "CMakeFiles/kcm_filetypes.dir/kservicelistwidget.o"
> "CMakeFiles/kcm_filetypes.dir/typeslistitem.o"
> "CMakeFiles/kcm_filetypes.dir/mimetypedata.o"
> "CMakeFiles/kcm_filetypes.dir/mimetypewriter.o"
> "CMakeFiles/kcm_filetypes.dir/newtypedlg.o"
> "CMakeFiles/kcm_filetypes.dir/kserviceselectdlg.o" -L/usr/local/lib
> -L/usr/local/kde4/lib -lQtCore -lpthread -lkdecore -lkdeui -lkio -lkparts
> -lQtCore -lpthread -lkdecore -lkpty -lQtXml -lQt3Support -lQtCore
> -lpthread -lkdecore -lkdeui -lkio -lkfile -lkde3support -lutil -lkdecore
> -lkdeui -lQtSvg -lSM -lICE -lX11 -lXext -lXft -lXau -lXdmcp -lXpm -lXtst
> -lXcursor -lXfixes -lkio -lstreamanalyzer -lstreams -lfam -lXrender
> -lkdecore -lQtNetwork -lz -lbz2 -lintl -lsolid -lQtCore -lpthread -lQtDBus
> -lQtXml -lQtGui

So the linker call is actually correct.

> /usr/local/bin/cmake -E
> cmake_progress_report
> /usr/ports/x11/kdebase4/work/kdebase-4.0.1/build/CMakeFiles
> 58
> [ 33%] Built target kcm_filetypes
> 
> This results in (reordered for readability):
> 
> # ldd kcm_filetypes.so
> ./kcm_filetypes.so:
>         libkdecore.so.6 => /usr/X11R6/lib/libkdecore.so.6 (0x28345000)
>         libkdecore.so.7 => /usr/local/kde4/lib/libkdecore.so.7 (0x29ef7000)
>         ...
>         libkdeui.so.6 => /usr/X11R6/lib/libkdeui.so.6 (0x2858d000)
>         libkdeui.so.7 => /usr/local/kde4/lib/libkdeui.so.7 (0x2a2b2000)
>         ...
> (the version numbers have been tweaked on our end as the KDE3 version have
> wrong versions).

Hmm, how does LD_LIBRARY_PATH look? Whats in /etc/ld.so.conf (if that
exists on BSD)? As you probably can see /usr/X11R6/lib is not even
mentioned anyhere in the linker call, so ld must pick up these paths
from somewhere else.

Andreas

-- 
You're growing out of some of your problems, but there are others that
you're growing into.


More information about the Kde-buildsystem mailing list