Is this a problem with cmake or with my setup?

Alexander Neundorf neundorf at kde.org
Wed Aug 4 21:37:35 CEST 2010


On Wednesday 04 August 2010, Michael Jansen wrote:
> On Wednesday 04 August 2010 00:45:01 Michael Jansen wrote:
> > Hi
> >
> > In the last days/week i get more and more linking problems. I have them
> > mostly with phonon. In my journey to better understand all that linking
> > stuff i kept searching for the reason. Here is what i found so far:
> >
> > The problem itself is easy. Qt ships a phonon without the symbol
> > Phonon::VideoPlayer::Event(QEvent*). This was added in phon git recently.
> > As we still haven't found a satisfying solution for the problem how to
> > build qt with respect to phonon if you want qt's phonon support AND
> > phonon from git i pretended there is no problem and compiled both qt with
> > phonon and phonon itself.
> >
> > Qt goes into /kde4/qt/4.6 (But it's 4.7 git/master)
> > Phonon goes into /kde4/trunk/support
> >
> > Given the promise of rpath and our advanced build system i hoped things
> > would work. But they do not. From time to time stuff suddenly fails to
> > link. The reason is simple.
> >
> > As an example currently kdepim is falling for me.
> >
> > cd /home/mjansen/kde4/trunk/bld/KDE/kdepim/akregator/export &&
> > /usr/bin/cmake -E cmake_link_script
> > CMakeFiles/akregatorstorageexporter.dir/link.txt --verbose=1
> > /kde4/trunk/kde/bin/c++    -Wnon-virtual-dtor -Wno-long-long -ansi
> > -Wundef -Wcast-align -Wchar- subscripts -Wall -W -Wpointer-arith
> > -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check- new
> > -fno-common
> > -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden
> > -fvisibility- inlines-hidden -g -O2 -fno-reorder-blocks
> > -fno-schedule-insns -fno-inline  -Wl,--enable-new-dtags -
> > Wl,--no-add-needed -Wl,--fatal-warnings
> > CMakeFiles/akregatorstorageexporter.dir/akregatorstorageexporter_automoc.
> >o CMakeFiles/akregatorstorageexporter.dir/akregatorstorageexporter.o  -o
> > akregatorstorageexporter - rdynamic -L/kde4/trunk/kde/lib64
> > -L/home/mjansen/kde4/trunk/bld/KDE/kdepim/lib -L/kde4/qt/4.6/lib64
> > /kde4/trunk/kde/lib64/libkdecore.so.5.6.0
> > /kde4/trunk/kde/lib64/libsyndication.so.4.6.0
> > ../../lib/libakregatorinterfaces.so.4.6.0
> > /kde4/trunk/kde/lib64/libsyndication.so.4.6.0
> > /kde4/trunk/kde/lib64/libkdecore.so.5.6.0 /kde4/qt/4.6/lib64/libQtDBus.so
> > /kde4/qt/4.6/lib64/libQtCore.so -lpthread -Wl,-
> > rpath,/home/mjansen/kde4/trunk/bld/KDE/kdepim/lib:/kde4/trunk/kde/lib64:/
> >kd e4/qt/4.6/lib64 -Wl,-
> > rpath-link,/home/mjansen/kde4/trunk/bld/KDE/kdepim/lib:/kde4/trunk/kde/li
> >b 64 /kde4/trunk/kde/lib64/libkhtml.so.5: undefined reference to
> > `Phonon::VideoPlayer::event(QEvent*)' collect2: ld returned 1 exit status
> > make[2]: *** [akregator/export/akregatorstorageexporter] Fehler 1
> > make[2]: Leaving directory `/home/mjansen/kde4/trunk/bld/KDE/kdepim'
> > make[1]: ***
> > [akregator/export/CMakeFiles/akregatorstorageexporter.dir/all] Fehler 2
> > make[1]: Leaving directory
> > `/home/mjansen/kde4/trunk/bld/KDE/kdepim' make: *** [all] Fehler 2
> >
> > As you can see it complains that it can't resolve a symbol for khtml.
> > Which is not specified on the commandline. It picks that up as a
> > dependency for some other shared lib. It then picks up a libphonon itself
> > too. The directories it looks into for those libs are those specified by
> > the linker command line option
> > -rpath-link,/home/mjansen/kde4/trunk/bld/KDE/kdepim/lib:/kde4/trunk/kde/l
> >i b64
>
> As usual i forgot something. If it can't find the lib in -rpath-link it
> looks into the directories specified with ,-
> -rpath,/home/mjansen/kde4/trunk/bld/KDE/kdepim/lib:/kde4/trunk/kde/lib64:/k
>de4/qt/4.6/lib64
>
> As we can see there is qt in there but no support. That's why it pick up
> phonon from qt instead of phonon from kdesupport.

Yes, correct.
For others following, here's the documentation:
http://sourceware.org/binutils/docs/ld/Options.html#Options

As long as there is no library which is in kdesupport/ I currently don't see a 
way how we can make ld use the libphonon in kdesupprt/ instead of the one in 
Qt/.
But libphonon is not explictely linked, since it's not in the link interface.
Removing the -Wundef should make it link...
Using the "full" link interface would make it link too...

Alex


More information about the Kde-buildsystem mailing list