微信分享SDK导入报错之Undefined symbols for architecture arm64

报错如下:

Undefined symbols for architecture arm64:
  "operator new[](unsigned long)", referenced from:
      +[WeChatApiUtil EncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil NsDataEncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil DecodeWithBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil DecodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
  "___cxa_begin_catch", referenced from:
      ___clang_call_terminate in libWeChatSDK.a(WechatAuthSDK.o)
  "operator delete[](void*)", referenced from:
      +[WeChatApiUtil EncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil NsDataEncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil DecodeWithBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil DecodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
  "std::terminate()", referenced from:
      ___clang_call_terminate in libWeChatSDK.a(WechatAuthSDK.o)
  "___gxx_personality_v0", referenced from:
      -[NSDictionary(NSDictionary_SafeJSON) wxApi_stringForKey:] in libWeChatSDK.a(WechatAuthSDK.o)
      -[NSDictionary(NSDictionary_SafeJSON) wxApi_arrayForKey:] in libWeChatSDK.a(WechatAuthSDK.o)
      -[NSDictionary(NSDictionary_SafeJSON) wxApi_dictionaryForKey:] in libWeChatSDK.a(WechatAuthSDK.o)
      -[NSDictionary(NSDictionary_SafeJSON) wxApi_integerForKey:] in libWeChatSDK.a(WechatAuthSDK.o)
      -[NSDictionary(NSDictionary_SafeJSON) wxApi_floatForKey:] in libWeChatSDK.a(WechatAuthSDK.o)
      -[NSDictionary(NSDictionary_SafeJSON) wxApi_doubleForKey:] in libWeChatSDK.a(WechatAuthSDK.o)
      -[WechatAuthSDK init] in libWeChatSDK.a(WechatAuthSDK.o)
      ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

错误原因

缺少libc++库,添加libc++库即可解决。

你可能感兴趣的:(微信分享SDK导入报错之Undefined symbols for architecture arm64)