【发布时间】:2017-09-07 23:17:30
【问题描述】:
我正在尝试访问在 .h 文件中声明的状态变量,但编译器说该变量不存在。我需要在桥接头文件中添加任何内容吗?
在我的 swift 文件中,我无法访问 dstate 或 cstate
编译器在g722_coder_init(&dstate) 行上显示“使用未解析的标识符'dstate'”。
头文件
#ifdef __cplusplus
extern "C" {
#endif
extern struct g722_dstate dstate;
extern struct g722_cstate cstate;
int g722_coder_init ( struct g722_cstate *s );
int g722_encode(short *data, unsigned char *outdata,int len, struct g722_cstate *s );
int g722_decoder_init ( struct g722_dstate *s);
int g722_decode(unsigned char *decdata, short *pcmout, int len, struct g722_dstate *s );
#ifdef __cplusplus
}
#endif
桥接头
#import "g722_codec.h"
【问题讨论】:
标签: swift swift3 header interop bridge