[CMake] static library linking

Steven Van Ingelgem steven at vaningelgem.be
Sun Jun 15 17:27:15 EDT 2008


Hmmm?


I don't seem to be able to make it link correctly?

I do:
set_property(TARGET ${SUB_PROJECT} PROPERTY IMPORTED_LOCATION ${PTHREAD}
${RT} ${LIBC})

But it's still somehow linking wrongly :(...

What would be the correct line for this?


The weird thing is... When I turn it off (the linking), it still tries to
link against pthread, rt & libc... I have no idea why? Doesn't it regenerate
the makefiles when you modify the CMakeLists.txt?


Thanks



2008/6/15 Alan W. Irwin <irwin at beluga.phys.uvic.ca>:

> 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_Librariesgives
> 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
> __________________________
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080615/5bbf99d8/attachment.htm>


More information about the CMake mailing list