मैं अपने स्विफ्ट प्रोजेक्ट में openssl आयात करने की कोशिश कर रहा हूं, लेकिन जब मैं 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
को नाम बदलकर त्रुटि तय की। क्या किसी को पता है कि चरित्र I
इतना खास क्यों है?
मैंने आज एक और परीक्षण किया, परिणाम इतना अजीब लग रहा है। मैं एक नया तेजी से प्रोजेक्ट बनाया, ने लिखा 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"
मैं फिर से संकलन त्रुटि मिल गया है!
आखिरकार, "#import" को हटाकर सबकुछ ठीक हो जाता है।
Why the character "I" could not work together with #import <xxx>?
यह अजीब लग रहा है (OpenSSL के अक्षरों के बीच में अतिरिक्त स्थान नोटिस):
यहाँ हमलावर लाइनों संकलक द्वारा सूचित कर रहे '.../OpenSSLRSAWrapper/ओ penssl/शामिल/.. .'। – jww
ऐसा लगता है कि किसी के पास कहीं भी 'डिफाईन' है, आप प्रीप्रोसेसर से परिणाम देख सकते हैं कि –
क्या हुआ है हम परिभाषा को हटाने के लिए '#undef I' का उपयोग कर सकते हैं। –