SHARESDK problems and solutions when porting to the iOS platform

Source: Internet
Author: User

Problem

Previously, my development environment was Windows7 (64bits) +vmware 9.0+mac OS 8.5+xcode 4.5, resulting in a test game integrating the current latest SHARESDK (SHARESDK for IOS 2.10.3, and SHARESDK For Cocos2d-x is also currently up-to-date) failed. A compilation error appears as shown:

And the second error is as follows:

    Obviously, both of these errors are from SHARESDK official documents. Note: In a game developed based on the COCOS2D-X framework, it takes two parts to integrate SHARESDK to implement the iOS version (which also includes part of the SHARESDK for iOS section above). For details, please study the Cocos2d-x Quick Integration Guide (URL is Http://wiki.mob.com/cocos2d-x%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E6%8C%87%E5%8D %97/, I am not currently using cocos2d-x 3.x Quick integration Guide , This source is based on Cocos2d-x 2.2.0, I am currently using cocos2d-x 2.2.3; However, soon I will also upgrade to the Cocos2d-x 3.x version of the integration).

Analysis

Previously, it was noted that all of the above errors revolve around new content in objective-c blocks (the OC and C + + mixed programming technician is used here). After studying this new point of knowledge carefully, I simply thought it might be SHARESDK official programming in blocks (because the article on the search network says that the built-in GCC compiler has supported blocks from Xcode 4.3, and I'm using Xcode 4.5+ LLVM GCC 4.2). Accordingly, the above two files were modified: Blocks the normal form of local variables extracted from the front to add to __block. In fact, it seems that I have not understood the blocks usage at all, the above expression is not a problem.


After two times to ask SHARESDK official responsible for friends, I basically locate the wrong reason in the current GCC version is too low (of course, around blocks). So, the malicious heart to download the new VMware Workstation 10.0.2+mac OS 10.9+xcode 6.1. It was basically bon voyage to go down when recompiling the previous project.


Add


After installing the new environment, I feel a lot of changes. One of the most obvious is that, in the original case, I just set the folder under Win7 to be shared with Mac OS 10.8 to open and operate the game project in Xcode 4.5, but now it's not--the famous error "Clang failed with exit code 254 ”。 Helpless, reference network article (http://zhidao.baidu.com/link?url=5WyS4C5HmSck8SECJsFBmVZaAYU6pyjCUKBGRhkkr3_ WIKG84PR8WKG4L5-KQGVZCRHIW-13EZF0LNEDY9HBIE4J1UCNJTWOZEVNGZ4ABLW), I had to copy the game project using the Finder from the original shared location to a folder inside Mac OS [documents] Under Re-compile and run the project ok!

SHARESDK problems and solutions when porting to the iOS platform

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.