首先遇到的问题就是微信SDK版本,
在微信开放平台下了官方SDK,在编译的时候各种报错,
"_OBJC_CLASS_$_WXApi", referenced from:
symbol(s) not found for architecture x86_64
在Google上找了一下午,真是浪费时间。后来发现下载的官方SDK解压后有两个文件夹:WeChatSDK_1.5 和 WeChatSDK_1.5_OnlyIphone。
我开发的是iphone版,所以想都没想就直接用了WeChatSDK_1.5_OnlyIphone,结果就是一直报错。
折腾了半天,改用WeChatSDK_1.5,不报上面的错误了,改成以下错误了
Undefined symbols for architecture x86_64: "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) "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) "___gxx_personality_v0", referenced from: Dwarf Exception Unwind Info (__eh_frame) in AppDelegate.o Dwarf Exception Unwind Info (__eh_frame) in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invoc
在网上查了半天,Linked Frameworks and Libraries里除了导入微信官方要求的东西外,还要添加libc++.dylib。
于是,编译通过了......