c and c++ compatibility -
i have downloaded code written in c, i've written cmakelists.txt access through eclipse , works fine , compiles.
my personal code written in c++. want call c code it, , i've created cmakelists.txt takes account c code is.
when build project there's no problem, long don't following instruction :
// in 1 of project's .cpp :
#ifdef __cplusplus extern "c" { #endif #include "c_header_file_i_need.h" #ifdef __cplusplus } #endif
// core of .cpp
the errors given tell me program attempting compile c code c++ compiler , therefore :
nested functions
void*
- ...
are not accepted compiler.
i've considered adapting c program, lot of work ...
since it's 1 compiler per cmakelists, wondering how able compile 2 parts of project independently , link them, using cmakelists (because need work on platform).
thank you help, , not hesitate tell me file/log need at.
Comments
Post a Comment