对于需要c++调用的全局变量或函数,如果是在.c中实现的,就需要用下面宏定义:


#ifdef __cplusplus
 extern "C" {
 #endif

 void testCFund();
int g_cVar;

 #ifdef __cplusplus
 }
 #endif

否则混合链接的时候,会提示找不到函数或变量。