Cocos2d-x v2.x version support for 64bit

Source: Internet
Author: User

The newly submitted app must support a 64-bit architecture after February 1, 2015.

I am using the Cocos2d-x V2.0 version, and the source code is partially modified. Fortunately, Cocos2d-x official has released a support 64-bit 2.2.6 version, can be used as a reference.

IOS 64-bit support for v2.x>>

Zip package Download >>

Before the change, it is necessary to understand some of the 32-bit and 64-bit differences, the online can search for a lot of information, here simply list (as far as possible by the way the chart)

I represents int, L code long, p for pointer

Through, it is easy to find the main difference between long and pointer.

Resources:

32-bit programs differ from 64-bit programs

Porting a Linux application to a 64-bit system

64-bit programming with 33 military records

Linux GCC 64-bit programming Tips

Issues of porting C + + code on the 64-bit platform

--------------------Gorgeous divider Line--------------------

There are some preparations to do, upgrade Mac OS, then install Xcode 6.x, only 6.x support ios8.x, and then set the options for build.

Then COMMAND + B to build, if the error, check the error message and then use Cocos2d-x 2.2.6 version of the code in comparison with the code currently in use, the modification is completed again after the build

Third party libraries: Libcurl Remember to replace, if you also use other library, remember also replace.

Most of the problems encountered during compilation can be answered by searching:)

The above process is relatively simple, for self-written code, if a function needs to get pointers to information, the int is changed to a long (the principle can be see the first picture of this article)

The main problem I encountered was

Undefined Symbols for Architecture arm64:
"Cocosdenshion::simpleaudioengine::p reloadeffect (char const*)", referenced from:

All the code that calls the Cocosdenshion method will show a problem, I am surprised, cocosdenshion I checked the parameters of the compilation, also checked the current compilation of the project's library Search Path, to verify that all are not problems, clean up, recompile , noisy for a long time or not resolved, until the next day suddenly see this error above a hint, there is a path, I used Shell to check a bit, found the problem:

There is a. A file under the directory, do not know how to operate, that is, it takes precedence over the library (32-bit) here, resulting in no matter how I compile and operate, the newly generated static library (LIBCOCOSDENSHION.A) is not used, delete, compile, everything OK, too pit, Spent a day and a half of the time >_<

The following is a description of the undefined symbols for architecture (online can search the question about it is not armv7 (s) is the use of Cocos2d-x v3.x processing scheme, about the cocos2d-x is almost no, good sadness ~ ~)

If the declaration of an identifier is not found in the source code, either the variable name, the class name, or the method name, the "use of undeclared identifier ' XXXX" error is obtained at compile time, and if the compiler finds its declaration and does not know how it is implemented, If you do not see the implementation code or the target file does not have this implementation, a link error will occur.

Error classification:

1) introduced the need to use the library header file, but did not link the correct implementation of the library. Because the library that Xcode natively supports is the static library, which is the. A method, only the. a file is implemented. When using the need to introduce additional header files, it is possible to put the head file in, did not put. A or put the wrong version.

2) Build settings or build phases configured incorrectly. Check the link Binary with libraries in build phases and the search Path in build settings.

3) files imported from the outside are not added to the specific target: A,. m,. Framework, etc. introduced into the project, but did not tick the current build target, this problem can be selected, select a specific file, in the right sidebar, select target.

4) does not contain an issue with the processor architecture instruction set. Error when the prompt is generally "Undefined symbols for Architecture armv7/arm64", and "for architecture armv7/arm64" means that there is no support armv7, in the build Several of the architecture related in settings need to be configured correctly.

Referenced from: http://www.molotang.com/articles/1593.html

Original: Http://stackoverflow.com/questions/6429494/undefined-symbols-for-architecture-armv7

Reference:

I was able to build the Cocos2d-x 2.2 in arm64 (Xcode 6.1) #9322

64-bit and IOS 8 Requirements for New Apps

Xcode upgrade to 5.1.1 (5b1008) solution that causes compilation problems

Modify cocos2d-2.0-x-2.0.3 Support c++11

Error when creating an archive of my Cocos2d app

Xcode upgrade 6.0.1 after undefined symbols for architecture arm64

Cocos2d-x v2.x version support for 64bit

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.