extern "C"
#ifdef __cplusplus
#define CI_EXTERN_C_BEGIN extern "C" {
#define CI_EXTERN_C_END }
#else
#define CI_EXTERN_C_BEGIN
#define CI_EXTERN_C_END
#endif
#ifdef __cplusplus
# define CORE_IMAGE_EXPORT extern "C" __attribute__((visibility("default")))
#else
# define CORE_IMAGE_EXPORT extern __attribute__((visibility("default")))
#endif
#define CORE_IMAGE_CLASS_EXPORT __attribute__((visibility("default")))extern "C" {
#include "some_c_library.h" // 引入 C 库头文件
}为什么需要 extern "C"
extern "C"使用方法
实际应用
Last updated