iOS 集成支付宝绑定、支付遇到的问题

2019-11-29  本文已影响0人  前尘梦醒

支付宝开放平台的demo地址:https://docs.open.alipay.com/54/104509/

我在集成支付宝SDK的时候遇到两个问题:

第一个问题:rsa.h头文件找不到

解决办法:在building settings里搜索Header Search Paths 添加文件所在路径 $(SRCROOT)/项目名/文件名

第二个问题:

Undefined symbols for architecture arm64:

  "_EVP_DecodeBlock", referenced from:

      _dataFromBase64String in openssl_wrapper.o

  "_BIO_free_all", referenced from:

      _rsa_sign_with_private_key_pem in openssl_wrapper.o

      _rsa_verify_with_public_key_pem in openssl_wrapper.o

  "_PEM_read_bio_RSA_PUBKEY", referenced from:

      _rsa_verify_with_public_key_pem in openssl_wrapper.o

  "_RSA_verify", referenced from:

      _rsa_verify_with_public_key_pem in openssl_wrapper.o

  "_BIO_new", referenced from:

      _rsa_sign_with_private_key_pem in openssl_wrapper.o

      _rsa_verify_with_public_key_pem in openssl_wrapper.o

  "_EVP_EncodeBlock", referenced from:

      _base64StringFromData in openssl_wrapper.o

  "_PEM_read_bio_RSAPrivateKey", referenced from:

      _rsa_sign_with_private_key_pem in openssl_wrapper.o

  "_RSA_check_key", referenced from:

      _rsa_sign_with_private_key_pem in openssl_wrapper.o

  "_SHA1", referenced from:

      _rsa_sign_with_private_key_pem in openssl_wrapper.o

      _rsa_verify_with_public_key_pem in openssl_wrapper.o

     (maybe you meant: __Z24alisec_crypto_SHA1_blockP26alisec_crypto_shastate_st_Pmi)

  "_RSA_sign", referenced from:

      _rsa_sign_with_private_key_pem in openssl_wrapper.o

  "_BIO_ctrl", referenced from:

      _rsa_sign_with_private_key_pem in openssl_wrapper.o

      _rsa_verify_with_public_key_pem in openssl_wrapper.o

  "_BIO_s_file", referenced from:

      _rsa_sign_with_private_key_pem in openssl_wrapper.o

      _rsa_verify_with_public_key_pem in openssl_wrapper.o

ld: symbol(s) not found for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

这是缺少libcrypto.a和libssl.a文件引起的,这两个文件在支付宝的demo中都有,添加进项目即可。

上一篇 下一篇

猜你喜欢

热点阅读