<br>I re-read my post and I gotta say I'm -again- unclear... Let me put this more detailed:<br>===============<br>add_library(<br>somename<br>shared<br><br>a.cpp)<br>target_link_libraries(somename /somepath/lib100m.a)<br>
<br>add_library(<br>otherlib<br>shared<br><br>b.cpp)<br>target_link_libraries(otherlib somename)<br>===============<br><br>The first lib will link against "lib100m.a".<br><br>The second lib however will link against both "libsomename.so" and the "lib100m.a"... The first lib-linking is correct, but the second one is not as that's not what I want... I want to use the symbols in the "lib100m.a" inside the first library, and use those to calculate stuff in there, but they're of no use whatsoever inside the second shared library... Because this one only uses symbols exported from the "libsomename.so", not from "lib100m.a".<br>
<br><br>Hopefully that makes my issue more clear ;).<br><br><br>Greetings<br><br><br><br><div class="gmail_quote">2008/6/15 Steven Van Ingelgem <<a href="mailto:steven@vaningelgem.be">steven@vaningelgem.be</a>>:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Another issue I just noticed... If you link to an "add_library" or so, it will add all the target linked libraries of the original "add_library", which is rather incorrect imho because I don't want to link every library to a 100M static library, that is only compiled in in 1 shared library...<br>
<br>Is there somehow I can turn this off?<br><br><br>Thanks!<br><br><div class="gmail_quote"><div class="Ih2E3d">2008/6/15 Steven Van Ingelgem <<a href="mailto:steven@vaningelgem.be" target="_blank">steven@vaningelgem.be</a>>:<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hmmm?<div><div></div><div class="Wj3C7c"><br><br><br>I don't seem to be able to make it link correctly?<br><br>I do: <br>set_property(TARGET ${SUB_PROJECT} PROPERTY IMPORTED_LOCATION ${PTHREAD} ${RT} ${LIBC})<br><br>
But it's still somehow linking wrongly :(...<br>
<br>What would be the correct line for this?<br><br><br>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?<br>
<br><br>Thanks<br>
<br><br><br><div class="gmail_quote"><div>2008/6/15 Alan W. Irwin <<a href="mailto:irwin@beluga.phys.uvic.ca" target="_blank">irwin@beluga.phys.uvic.ca</a>>:<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>On 2008-06-15 21:58+0200 Steven Van Ingelgem wrote:<br>
<br>
</div><div><div></div><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Alan,<br>
<br>
<br><div>
It doesn't want to link with the -Bstatic... But it links nicely with the<br>
static paths...<br>
In fact on the system is only 1 libpthread.a ... And that's not what is<br>
getting linked against because it returns errors related to symbols which<br>
cannot be found in the .so (somehow).<br>
<br>
I have no idea what's going on, but getting a list of ld which libraries it<br>
will link would certainly be helpful.<br>
</div></blockquote>
<br>
Hi Steven:<br>
<br>
Brad's link <a href="http://www.cmake.org/Wiki/CMake_2.6_Notes#Linking_to_System_Libraries" target="_blank">http://www.cmake.org/Wiki/CMake_2.6_Notes#Linking_to_System_Libraries</a> gives<br>
a lot of the relevant background as to why CMake specifies linking the way<br>
it does and at the end gives you a way to do exactly what you want (specify<br>
the exact static library). My thanks to Brad for drawing my attention to<br>
that link.<br>
<br>
But if you (Steven) are curious enough to further pursue the -l issue which<br>
you seem to have discovered (which might be a good idea anyhow since<br>
something may be fundamentally wrong with your linker version), please let<br>
me know the complete link command (and any associated warning or error<br>
messages). To do that use the make VERBOSE=1 option. Please also send the<br>
complete results of running "ldd -r" on the executable that is produced. (If<br>
there is a linking error, you can run the linking command again by hand<br>
using the --noinhibit-exec option to generate an executable regardless of<br>
most errors.)<div><div></div><div><br>
<br>
Alan<br>
__________________________<br>
Alan W. Irwin<br>
<br>
Astronomical research affiliation with Department of Physics and Astronomy,<br>
University of Victoria (<a href="http://astrowww.phys.uvic.ca" target="_blank">astrowww.phys.uvic.ca</a>).<br>
<br>
Programming affiliations with the FreeEOS equation-of-state implementation<br>
for stellar interiors (<a href="http://freeeos.sf.net" target="_blank">freeeos.sf.net</a>); PLplot scientific plotting software<br>
package (<a href="http://plplot.org" target="_blank">plplot.org</a>); the libLASi project (<a href="http://unifont.org/lasi" target="_blank">unifont.org/lasi</a>); the Loads of<br>
Linux Links project (<a href="http://loll.sf.net" target="_blank">loll.sf.net</a>); and the Linux Brochure Project<br>
(<a href="http://lbproject.sf.net" target="_blank">lbproject.sf.net</a>).<br>
__________________________<br>
<br>
Linux-powered Science<br>
__________________________<br>
</div></div></div></div></blockquote></div><br>
</div></div></blockquote></div><br>
</blockquote></div><br>