Problem solved. The problem with linking with the C++ lib comes from C++ lib, and has nothing to do with CMake
Thanks. 2011/6/1 Hendrik Sattler <[email protected]> > Zitat von Maxime Lecourt <[email protected]>: > > The declarations in my_c_header.h are surrounded by >> >> #if defined(__cplusplus) >> extern "C" { >> #endif >> // functions and stuff declarations >> #if defined(__cplusplus) >> } >> #endif >> >> 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. >> > > This should work, the definition is automatically set by the C++ compiler > and unset for the C compiler. > Are the "undefined references" actually symbols in your C files? Did you > turn all warnings on (suggested) with -Wall -Wextra? > > 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. > > HS > > >
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
