C 文件调用 C++ 文件中的函数时,不被识别时的处理方法!
C语言的头文件,需要加上如下条件编译及限制代码:
#ifdef __cplusplus
extern "C" {
#endif
//原文件内容
#ifdef __cplusplus
}
#endif
或者直接
在C 文件 写上
extern "C"
{
//原文件内容
}
C 文件调用 C++ 文件中的函数时,不被识别时的处理方法!
C语言的头文件,需要加上如下条件编译及限制代码:
#ifdef __cplusplus
extern "C" {
#endif
//原文件内容
#ifdef __cplusplus
}
#endif
或者直接
在C 文件 写上
extern "C"
{
//原文件内容
}