Problem solved.<br>The problem with linking with the C++ lib comes from C++ lib, and has nothing to do with CMake<br><br>Thanks.<br><br><div class="gmail_quote">2011/6/1 Hendrik Sattler <span dir="ltr">&lt;<a href="mailto:post@hendrik-sattler.de">post@hendrik-sattler.de</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">Zitat von Maxime Lecourt &lt;<a href="mailto:maxime.lecourt@gmail.com" target="_blank">maxime.lecourt@gmail.com</a>&gt;:<br>

<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The declarations in my_c_header.h are surrounded by<br>
<br>
#if defined(__cplusplus)<br>
    extern  &quot;C&quot; {<br>
#endif<br>
// functions and stuff declarations<br>
#if defined(__cplusplus)<br>
    }<br>
#endif<br>
<br>
So i&#39;m not sure about whether it&#39;s taken into account or not, and how to<br>
have CMake take it into account when I compile my library as C.<br>
</blockquote>
<br></div>
This should work, the definition is automatically set by the C++ compiler and unset for the C compiler.<br>
Are the &quot;undefined references&quot; actually symbols in your C files? Did you turn all warnings on (suggested) with -Wall -Wextra?<br>
<br>
The problem with compile C as C++ is that those are actually two different languages. It may work but the result will not always be the same.<br><font color="#888888">
<br>
HS<br>
<br>
<br>
</font></blockquote></div><br>