Forum Discussion
Altera_Forum
Honored Contributor
16 years agoUse extern "C" when mixing C++ and C code
__cplusplus will be automatically defined if your compiler is a C++ compiler Use this in your header files ...#if defined(__cplusplus)
extern "C" { // Make sure we have C-declarations in C++ programs # endif
void yourCFunction();
# if defined(__cplusplus)
}# endif Have a look a this link http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html (http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html) Best regards