[CMake] [CMAKE] setting list with different directories ?

Hendrik Sattler post at hendrik-sattler.de
Wed Jun 1 05:40:26 EDT 2011


Zitat von Maxime Lecourt <maxime.lecourt at gmail.com>:
> I'm having what is probably a newbie problem, but a problem to me.
>
> I have C source files in two different directories, that I use to build a
> dll, that is loaded by another C++ project.
>
> I tried to build C objects and link with C++
> set_target_properties(ppc PROPERTIES LINK_FLAGS "-Wl,--kill-at"
> LINKER_LANGUAGE "CXX")
> but I have linker problem (undefined references) when trying to link my C++
> project.
>
> So I decided to build my library as C++ and not C.

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
extern "C" {
#include "my_c_header.h"
}
lines for inclusion of the C header files.

HS





More information about the CMake mailing list