figuring out linker error on the dashboard
Robby Stephenson
robby at periapsis.org
Thu Oct 15 15:25:48 CEST 2009
On Wednesday 14 October 2009, Alexander Neundorf wrote:
> Can you please post the part which you snipped ?
Right, I guess I removed the important part, eh?
http://developer.kde.org/~dirk/dashboard/
cd tellico/src/tests && /usr/bin/cmake -E cmake_link_script
CMakeFiles/gcstartest.dir/link.txt --verbose=1
/usr/local/bin/c++ -O2 -march=i586 -mtune=i686 -fmessage-length=0 -Wall -
D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-
tables -Werror=format-security -Wmissing-format-attribute -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 -Wnon-virtual-dtor -Wno-long-
long -pedantic -Wextra -fno-check-new -O2 -DNDEBUG -DQT_NO_DEBUG -fPIC -
Wl,--enable-new-dtags CMakeFiles/gcstartest.dir/gcstartest_automoc.o
CMakeFiles/gcstartest.dir/gcstartest.o -o gcstartest -rdynamic -Llib -Llib
../../../lib/libtranslators.a ../../../lib/libmodels.a -lQtTest
lib/libkdeui.so.5.4.0 lib/libkio.so.5.4.0 -lqimageblitz -lxml2 -lxslt -
lexslt ../../../lib/libtellicotest.a ../../../lib/libcollections.a
../../../lib/libtranslators.a ../../../lib/libutils.a ../../../lib/libcore.a
../../../lib/libimages.a ../../../lib/libcore.a ../../../lib/libgui.a
lib/libkdeui.so.5.4.0 -lQtSvg lib/libkdecore.so.5.4.0 -lQtDBus -lQtCore -
lpthread -lQtNetwork -lQtXml -lQtGui -Wl,-rpath,lib -Wl,-rpath-link,lib
../../../lib/libimages.a(imagefactory.o): In function
`Tellico::ImageFactory::createStyleImages(int, Tellico::StyleOptions
const&)':
imagefactory.cpp:(.text+0x49a4): undefined reference to
`Blitz::gradient(QSize const&, QColor const&, QColor const&,
Blitz::GradientType)'
imagefactory.cpp:(.text+0x4a7c): undefined reference to
`Blitz::unbalancedGradient(QSize const&, QColor const&, QColor const&,
Blitz::GradientType, int, int)'
collect2: ld returned 1 exit status
>
-lqimageblitz does come before ../../../lib/libimages.a there, it appears.
> Yes. Even if it's static, if it uses symbols from QImageBlitz, you
> should "link" it against QImageBlitz when using cmake. This will not
> really change anything in the binary static library file created, but
> then cmake will know that libimage needs QImageBlitz and will link
> everything you link against libimage also against QIMageBlitz.
OK, that makes sense. It still puzzles me as to why that problem has only
shown up on the dashboard build so far. No one else has experienced it...
> > At one point, I did notice weird things happened if I changed the order
> > of the libraries listed in the TARGET_LINK_LIBRARIES macro. I suppose
> > that
>
> For static libraries the order matters.
> If you have only static libs, if libA uses something from libB, then libB
> has to come after libA in the link command (it doesn't matter if it
> already appeared before). The linker loads the object files from libA
> which contain symbols used by "somebody". If these object files reference
> symbols which haven't been referenced before, it searches the libraries
> following libA for these symbols.
Thanks. All of my subdirectories are static libs that I link back to the
main executable or test executable. I assume that's a typical way of setting
things up? I'll need to add Qt and kdecore, at the least, to every lib, I
think...
I appreciate the help.
Robby
More information about the Kde-buildsystem
mailing list