The declarations in my_c_header.h are surrounded by<br><br>#if defined(__cplusplus)<br> extern "C" {<br>#endif<br>// functions and stuff declarations<br>#if defined(__cplusplus) <br> }<br>#endif<br><br>So i'm not sure about whether it's taken into account or not, and how to have CMake take it into account when I compile my library as C.<br>
<br>Maxime Lecourt<br><br><br><div class="gmail_quote">2011/6/1 Hendrik Sattler <span dir="ltr"><<a href="mailto:post@hendrik-sattler.de">post@hendrik-sattler.de</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Zitat von Maxime Lecourt <<a href="mailto:maxime.lecourt@gmail.com" target="_blank">maxime.lecourt@gmail.com</a>>:<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm having what is probably a newbie problem, but a problem to me.<br>
<br>
I have C source files in two different directories, that I use to build a<br>
dll, that is loaded by another C++ project.<br>
<br>
I tried to build C objects and link with C++<br>
set_target_properties(ppc PROPERTIES LINK_FLAGS "-Wl,--kill-at"<br>
LINKER_LANGUAGE "CXX")<br>
but I have linker problem (undefined references) when trying to link my C++<br>
project.<br>
<br>
So I decided to build my library as C++ and not C.<br>
</blockquote>
<br></div>
Known problem but wrong decision. If your library is C, then compile it as C, not as C++. Your real problem is that you probably forgot the<br>
extern "C" {<br>
#include "my_c_header.h"<br>
}<br>
lines for inclusion of the C header files.<br>
<br>
HS<br>
<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/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>
</blockquote></div><br>