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

ios – 使用函数指针声明编译错误,第1张

概述我试图将openssl导入到我的 swift项目中,但是当我在xxx-Bridging-Header.h中添加了#import“ras.h”时,我在下面得到了编译错误. <unknown>:0: error: /Users/wenyun/workspace/newsvn/newios/ios/VanJoyPay2/VanJoyPay2/opensource/OpenSSLRSAWrapper/op 我试图将openssl导入到我的 swift项目中,但是当我在xxx-BrIDging-header.h中添加了#import“ras.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 '('

ras.h:100是:

int (*rsa_mod_exp)(BIGNUM *r0,const BIGNUM *I,RSA *rsa,BN_CTX *ctx); /* Can be null */

我通过将const BIGNUM * I重命名为const BIGNUM * i来修复错误.有人知道我为什么这么特别的角色?

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

test.hint test(char *I);test2.h#import "test3.h"#import <Foundation/Foundation.h>test3.hint test3();xxx-BrIDging-header.h#import "test2.h"#import "test.h"

我再次收到编译错误!

最后,删除“#import”使一切都可以.

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

解决方法 问题不在于Swift.它是由/usr/include/complex.h文件中的I的以前定义引起的(如 Brian Chen所猜测的).

以下是编译器报告的违规行:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhonesimulator.platform/Developer/SDKs/iPhonesimulator8.1.sdk/usr/include/complex.h:42:11: note: expanded from macro 'I'#define I _Complex_I
总结

以上是内存溢出为你收集整理的ios – 使用函数指针声明编译错误全部内容,希望文章能够帮你解决ios – 使用函数指针声明编译错误所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1113400.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存