Wrong order of -L?

Alexander Dymo dymo at mk.ukrtelecom.ua
Sun Apr 16 13:26:17 CEST 2006


I've noticed this when compiling kdevelop today.
We have -L<KDE installation directory> listed first in the compiler command
line. This leads to link errors because wrong libraries are picked up.
It links old installed libraries and not newer ones from the source tree.

In kdevelop/src/CMakeLists.txt we have
...
target_link_libraries(kdevshell ${KDE4_KDECORE_LIBS} kdeui profileengine 
kdevinterfaces kdevutil kdevwidgets newui khtml ktexteditor)
..

And when libkdevwidgets.so from build dir contains new symbols, the link
ends with an error:

/usr/bin/c++  ... -L/home/gremlin/bin/kde4/lib 
-L/home/gremlin/projects/oss/kde_svn/trunk/kdevelop_build/lib ... -lkdecore 
-lkdeui -lprofileengine -lkdevinterfaces -lkdevutil -lkdevwidgets -lnewui 
-lkhtml -lktexteditor -lkdevinterfaces ...
...
undefined reference to ...

The error is because of the wrong order of -L parameters. 
-L/home/gremlin/bin/kde4/lib should go after -L pathes to the build dir.

Can the order be changed somehow?


More information about the Kde-buildsystem mailing list