小编ywe*_*wen的帖子

使用函数指针声明编译错误

我正在尝试将openssl导入到我的swift项目中,但是当我添加#import "ras.h"xxx-Bridging-Header.h,我得到了下面的编译错误.

<unknown>:0: error: /Users/wenyun/workspace/newsvn/newios/ios/VanJoyPay2/VanJoyPay2/opensource/OpenSSLRSAWrapper/openssl/include/openssl/rsa.h:100: expected ')'
<unknown>:0: note: /Users/wenyun/workspace/newsvn/newios/ios/VanJoyPay2/VanJoyPay2/opensource/OpenSSLRSAWrapper/o penssl/include/openssl/rsa.h:100: to match this '('
Run Code Online (Sandbox Code Playgroud)

ras.h:100是:

int (*rsa_mod_exp)(BIGNUM *r0,const BIGNUM *I,RSA *rsa,BN_CTX *ctx); /* Can be null */
Run Code Online (Sandbox Code Playgroud)

我通过重命名const BIGNUM *I来修复错误const BIGNUM *i.有谁知道角色为何I如此特别?

我今天做了另一个测试,结果看起来很奇怪.我创建了一个新的swift项目,编写了3个头文件:

test.h
int test(char *I);

test2.h
#import "test3.h"
#import <Foundation/Foundation.h>

test3.h
int test3();


xxx-Bridging-Header.h
#import "test2.h"
#import "test.h"
Run Code Online (Sandbox Code Playgroud)

我又得到了编译错误!

最后,删除"#import"使一切正常.

Why the character "I" could not work together with #import <xxx>?

openssl compiler-errors ios

16
推荐指数
1
解决办法
1035
查看次数

标签 统计

compiler-errors ×1

ios ×1

openssl ×1