[CMake] static library linking

Alan W. Irwin irwin at beluga.phys.uvic.ca
Sun Jun 15 16:33:47 EDT 2008


On 2008-06-15 21:58+0200 Steven Van Ingelgem wrote:

> Hi Alan,
>
>
> It doesn't want to link with the -Bstatic... But it links nicely with the
> static paths...
> In fact on the system is only 1 libpthread.a ... And that's not what is
> getting linked against because it returns errors related to symbols which
> cannot be found in the .so (somehow).
>
> I have no idea what's going on, but getting a list of ld which libraries it
> will link would certainly be helpful.

Hi Steven:

Brad's link 
http://www.cmake.org/Wiki/CMake_2.6_Notes#Linking_to_System_Libraries gives
a lot of the relevant background as to why CMake specifies linking the way
it does and at the end gives you a way to do exactly what you want (specify
the exact static library).  My thanks to Brad for drawing my attention to
that link.

But if you (Steven) are curious enough to further pursue the -l issue which
you seem to have discovered (which might be a good idea anyhow since
something may be fundamentally wrong with your linker version), please let
me know the complete link command (and any associated warning or error
messages).  To do that use the make VERBOSE=1 option. Please also send the
complete results of running "ldd -r" on the executable that is produced. (If
there is a linking error, you can run the linking command again by hand
using the --noinhibit-exec option to generate an executable regardless of
most errors.)

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list