ldd reports that is not dynamically executable, as expected. But even ldd saying that, the problem with GLIBC occurs.<div><br><div class="gmail_quote">On Thu, Nov 3, 2011 at 3:33 PM, Michael Hertling <span dir="ltr">&lt;<a href="mailto:mhertling@online.de">mhertling@online.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 11/03/2011 06:20 PM, Mauricio Klein wrote:<br>
&gt; The error reported occurs in the launch time: the daemon doesn&#39;t starts and<br>
</div>&gt; report (in terminal) a GLIBC version error. [...]<br>
<br>
Usually, this means that it has *not* been linked statically against<br>
the GLIBC on the build system. Which dependencies does ldd report?<br>
<br>
&gt; [...] I mean, the daemon was compiled<br>
<div><div></div><div class="h5">&gt; in a old CentOS (4.8) and i&#39;m trying to run in the latest Ubuntu.<br>
&gt;<br>
&gt; But anyway, i will make more tests as you sugested and try to discovery<br>
&gt; what exactly is happening.<br>
&gt;<br>
&gt; Once again, thank you so much for your help!<br>
&gt;<br>
&gt; On Thu, Nov 3, 2011 at 3:09 PM, Michael Hertling &lt;<a href="mailto:mhertling@online.de">mhertling@online.de</a>&gt;wrote:<br>
&gt;<br>
&gt;&gt; On 11/03/2011 03:51 PM, Mauricio Klein wrote:<br>
&gt;&gt;&gt; Thank you Raphael, it worked!<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; One last question: i&#39;ve tried to compile my code using static linkage,<br>
&gt;&gt; once<br>
&gt;&gt;&gt; i need my daemon runs in many Linux releases. But, even static, in many<br>
&gt;&gt;&gt; systems my code crashes because the GLIBC version.<br>
&gt;&gt;<br>
&gt;&gt; How do these crashes manifest themselves, e.g. shell/syslog messages,<br>
&gt;&gt; return values, core dumps etc.? Are you sure they are related to the<br>
&gt;&gt; GLIBC version? Does the executable actually have no single dependency<br>
&gt;&gt; on any shared library, i.e. is it linked statically in its entirety?<br>
&gt;&gt; What does ldd or readelf report?<br>
&gt;&gt;<br>
&gt;&gt;&gt; My question is: asking for static linkage in CMake can solve this<br>
&gt;&gt; problem?<br>
&gt;&gt;<br>
&gt;&gt; If even a statically linked executable crashes on the target system,<br>
&gt;&gt; telling CMake to link statically will hardly solve this problem. ;)<br>
&gt;&gt;<br>
&gt;&gt;&gt; Or maybe another approach in CMake, where i embed all the needed<br>
&gt;&gt;&gt; libraries...<br>
&gt;&gt;<br>
&gt;&gt; You might take a look the the BundleUtilities Module, but at first,<br>
&gt;&gt; I&#39;d recommend to investigate what exactly causes the crashes. Your<br>
&gt;&gt; best bet is probably to provide a tiny but self-contained example<br>
&gt;&gt; that works on your development platform and crashes on a target<br>
&gt;&gt; system, along with some information about the latter&#39;s setup.<br>
&gt;&gt;<br>
&gt;&gt; Regards,<br>
&gt;&gt;<br>
&gt;&gt; Michael<br>
&gt;&gt;<br>
&gt;&gt;&gt; On Thu, Nov 3, 2011 at 12:19 PM, Raphael Kubo da Costa<br>
&gt;&gt;&gt; &lt;<a href="mailto:rakuco@freebsd.org">rakuco@freebsd.org</a>&gt;wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Mauricio Klein<br>
&gt;&gt;&gt;&gt; &lt;<a href="mailto:mauricio.klein.msk@gmail.com">mauricio.klein.msk@gmail.com</a>&gt; writes:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; I can compile all my codes without problems, but in the linkage step, i<br>
&gt;&gt;&gt;&gt;&gt; receive a lot of errors about undefined reference to OpenSSL functions<br>
&gt;&gt;&gt;&gt;&gt; (yes, my code uses OpenSSL).<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; In my own (and ugly :P) Makefile, i use &quot;-lssl&quot; flag in g++ compile<br>
&gt;&gt; line.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; My question is: how can i pass this flag in CMake.<br>
&gt;&gt;&gt;&gt;&gt; Also, i&#39;m not sure if i&#39;m using CMake correctly. Is correctly use<br>
&gt;&gt; &quot;-lssl&quot;<br>
&gt;&gt;&gt;&gt;&gt; flag in CMake or i need to copy the library to a folder inside my<br>
&gt;&gt; project<br>
&gt;&gt;&gt;&gt;&gt; and link to this copy?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; You need to find OpenSSL with `find_package(OpenSSL)&#39; and then, assuming<br>
&gt;&gt;&gt;&gt; it is found (ie. OPENSSL_FOUND is true), link to its libraries with<br>
&gt;&gt;&gt;&gt; `target_link_libraries(YOUR_APP ${OPENSSL_LIBRARIES})&#39;.<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/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/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/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>