#ifdef __cplusplus #if __cplusplus extern "C"{ #endif /* __cplusplus */ #endif /* __cplusplus */ 这里面写的函数是C语言编译方式 主要是函数命名方面 #ifdef __cplusplus #if __cplusplus } #endif /* __cplusplus */ #endif /* __cplusplus */ ===================================== 简单的用在windows下可以如下定义: #ifdef __cplusplus extern "C"{ //... 正常的声明段 } #endif