Hi Alan,<br><br><br>I don&#39;t know why, but if I take the build command from cmake, and I insert the static libraries in there, it works all right. So somehow it&#39;s reverting itself to some other version of the static and/or dynamic libraries.<br>
<br>The entire point of me reporting this in fact is that in cmake cvs this should have been resolved... Meaning that if I say in my CMakeLists file to link against the static library, it should just keep that link... Not try to be smart and change it ;-).<br>
<br><br>Greetings,<br>Steven<br><br><div class="gmail_quote">2008/6/15 Alan W. Irwin &lt;<a href="mailto:irwin@beluga.phys.uvic.ca">irwin@beluga.phys.uvic.ca</a>&gt;:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On 2008-06-15 11:47+0200 Steven Van Ingelgem wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
A small example (and verified on a clean SUSE installation):<br>
<br>
====================<br>
PROJECT(test)<br>
<br>
cmake_policy(SET CMP0003 NEW)<br>
<br>
ADD_EXECUTABLE(<br>
&nbsp;test<br>
&nbsp;main.cpp<br>
)<br>
TARGET_LINK_LIBRARIES(<br>
&nbsp;test<br>
&nbsp;/usr/lib/libpthread.a<br>
&nbsp;/usr/lib/librt.a<br>
&nbsp;/usr/lib/libc.a<br>
)<br>
====================<br>
<br>
==&gt; this won&#39;t set the .a&#39;s in the commandline as it should do, but rather<br>
link it via -Wl,-Bstatic...<br>
<br>
<br>
And I really need those static links, because no single other library on the<br>
system exports the required symbols, not even the shared ones.<br>
</blockquote>
<br></div>
Out of curiosity, why doesn&#39;t -Wl,-Bstatic -lpthread do exactly what you<br>
want? According to the Linux ld man page, -Bstatic means &quot;do not link<br>
against shared libraries&quot; so shouldn&#39;t that have the identical result as<br>
specifying /usr/lib/libpthread.a?<br>
<br>
To double-check what is happening with the linking, use &quot;ldd -r&quot; to list<br>
all the shared (but not static) libraries being linked to by test and to<br>
show any symbols which are not resolved by the link. &nbsp;You can also use<br>
nm to look for unresolved symbols.<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>
</blockquote></div><br>