美文网首页
iOS 集成支付宝绑定、支付遇到的问题

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

作者: 前尘梦醒 | 来源:发表于2019-11-29 16:52 被阅读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中都有,添加进项目即可。

    相关文章

      网友评论

          本文标题:iOS 集成支付宝绑定、支付遇到的问题

          本文链接:https://www.haomeiwen.com/subject/onygwctx.html