I see.<div><br></div><div>Well, i will research about package managers to perform this tasks automatically. Better than manipulate libraries myself.</div><div><br></div><div>Thanks guys for every reply sent!<br><br><div class="gmail_quote">

On Fri, Nov 4, 2011 at 5:00 AM, Hendrik Sattler <span dir="ltr">&lt;<a href="mailto:post@hendrik-sattler.de">post@hendrik-sattler.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Am 03.11.2011 15:51, schrieb Mauricio Klein:<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thank you Raphael, it worked!<br>
<br>
One last question: i&#39;ve tried to compile my code using static linkage, once<br>
i need my daemon runs in many Linux releases. But, even static, in many<br>
systems my code crashes because the GLIBC version.<br>
<br>
My question is: asking for static linkage in CMake can solve this problem?<br>
Or maybe another approach in CMake, where i embed all the needed<br>
libraries...<br>
<br>
Thanks for your attention!<br>
<br>
On Thu, Nov 3, 2011 at 12:19 PM, Raphael Kubo da Costa<br>
&lt;<a href="mailto:rakuco@freebsd.org" target="_blank">rakuco@freebsd.org</a>&gt;wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Mauricio Klein<br>
&lt;<a href="mailto:mauricio.klein.msk@gmail.com" target="_blank">mauricio.klein.msk@gmail.com</a>&gt; writes:<br>
<br>
&gt; I can compile all my codes without problems, but in the linkage step, i<br>
&gt; receive a lot of errors about undefined reference to OpenSSL functions<br>
&gt; (yes, my code uses OpenSSL).<br>
&gt;<br>
&gt; In my own (and ugly :P) Makefile, i use &quot;-lssl&quot; flag in g++ compile line.<br>
&gt;<br>
&gt; My question is: how can i pass this flag in CMake.<br>
&gt; Also, i&#39;m not sure if i&#39;m using CMake correctly. Is correctly use &quot;-lssl&quot;<br>
&gt; flag in CMake or i need to copy the library to a folder inside my project<br>
&gt; and link to this copy?<br>
<br>
You need to find OpenSSL with `find_package(OpenSSL)&#39; and then, assuming<br>
it is found (ie. OPENSSL_FOUND is true), link to its libraries with<br>
`target_link_libraries(YOUR_<u></u>APP ${OPENSSL_LIBRARIES})&#39;.<br>
</blockquote></blockquote>
<br></div>
After the issues with glibc were already mentioned, be also aware that static linking to openssl is really not recommended. Just look at the history of security updates to openssl. Do you really want to ship a new executable on every update of any statically linked library? Probably not.<br>


The only good reason these days to link statically is maybe some performance hit shared libraries.<br><font color="#888888">
<br>
HS</font><div><div></div><div class="h5"><br>
<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<u></u>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/<u></u>CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/<u></u>listinfo/cmake</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Best regards,<br><br>Maurício Souza Klein.<br>
</div>