reduced link interface: some link breakage possible

Alexander Neundorf neundorf at kde.org
Tue Dec 16 22:19:45 CET 2008


On Tuesday 16 December 2008, Boudewijn Rempt wrote:
> On Mon, 15 Dec 2008, Alexander Neundorf wrote:
> > Hi,
> >
> > I just committed a patch which enables the reduced link interface for
> > shared libraries unconditionally for all libs created using
> > KDE4_ADD_LIBRARY().
> >
> > So if you suddenly get some undefined symbols when linking, this may very
> > well be the reason.
> >
> > What to do then ?
> >  1.) Don't panic !
> >  2.) You are probably using symbols from some library which you don't
> > link to directly, but which was dragged in via one of the other libraries
> > you link to, and these "dragged in" libraries have now been mostly
> > removed. In this case, add these missing libraries explicitely to the
> > TARGET_LINK_LIBRARIES() command.
> > (because: less dependencies for packages, faster startup, some advantages
> > in keeping binary compatiblity).
> >  3.) If that doesn't help, ask on kde-core-devel or kde-buildsystem.
> >
> > I know it's late in the release cycle, but it wasn't possible earlier,
> > and we can't wait any longer with this, so we have to go through this
> > now.
> >
> > Hope that not too much breaks,
>
> Could this be the reason for the following error in KOffice:
>
> Linking CXX executable TestStorage.app/Contents/MacOS/TestStorage
> Undefined symbols:
>   "QApplication::QApplication(int&, char**, bool, int)", referenced from:
>       _main in TestStorage.o
>   "QApplication::~QApplication()", referenced from:
>       _main in TestStorage.o
>       _main in TestStorage.o
> ld: symbol(s) not found

There are two ways how to fix it:
1) add QT_QT_UI_LIBRARY to the link interface of the library kostore 
2) link the TestStorage against QT_QTUI_LIBRARY (as David did)

If kostore has symbols from QtUi in its headers, QT_QTUI_LIBRARY should be 
added to the link interface. But it doesn't look like this.
So adding QT_QTUI_LIBRARY to the target_link_libraries() of TestStorage is the 
right thing to do.
We could think about adding some convenience by putting QtUi (and maybe kdeui) 
into the link interface of kostore. 
But packagers don't like that. 

I see David added both ${QT_QTGUI_LIBRARY}  and ${KDE4_KDEUI_LIBS}.
KDE4_KDEUI_LIBS should be enough, this has QtUi in its link interface (since 
it has symbols from it in its headers). Can you please test that ?
Ok, I see, it may be a bit hard to figure out which library has what in its 
link interface.
I don't really have a good suggestion here.

Alex


More information about the Kde-buildsystem mailing list