Build cocos2d-x Android development environment in eclipse (free cygwin)

Source: Internet
Author: User

Build cocos2d-x Android development environment in eclipse (free cygwin)

After a few days of assault on Android development, I began to turn to Cocos2d-x's Android development. Because I have learned about the development of cocos2d-x, at that time I also learned a lot of game engine, I think cocos2d-x as a game engine is relatively humble, did not think Cocos2d-x now ASB, this is far from my mind. So also catch trend of the last bus, check data smoothly in Eclipse build cocos2d-x androd development environment.

original article, against undeclared references. Original Blog address:http://blog.csdn.net/gamesdev/article/details/29359291

First spit trough a cocos2d-x, take doctrine obvious, and is mechanically. But I heard that Cocos2d-x 3 will be changed ... Who knows, big and small game companies still use the Cocos2d-x 2.x version. Second, cocos2d-x from the technical point of no novelty. How to render using the render tree The big 3D engines are already used, and the memory management is not the one that nobody did, as early as 2004, a game developer abroad wrote a book about how to build a memory pool. In addition, the memory pool of Cocos2d-x may encounter a multi-threaded error, because Ccpoolmanager is a singleton, it is not thread-safe. A memory access error must occur to manage threads in different threads. These are pits, be sure to pay attention.

The next step is to introduce how to build the environment. First download eclipse, Android SDK, Android NDK, ADT.

Then, according to the Common Android development environment, the ADT is installed through Eclipse's installation of new software. Test until the general Android program is able to run.

Next, open Eclipse and import your existing Android project. The version I used Cocos2d-x was 2.2.3, the last version of Cocos2d-x in the 2 era (who knows?).


The first thing we're importing is libcocos2dx.


Then import the test project Testcpp.

The PATH is then set, which is used to look for environments such as bash, without adding an issue that will be reported (error:program "bash" is not found in PATH). This requires us to download a Unix-like environment, I download git here, it satisfies such conditions, Msys is also possible, but requires additional download.

Next, set the Ndk_root.

Finally, we need to find the make (Gnumake) program, which is why some people say they need to Cygwin. However, I do not have Cygwin, but there are mingw, I use MinGW mingw32-make.exe to replace it, there will be no mistake, because make is used to parse the compilation, link instruction, not directly involved in the compilation.

Everything is ready to start compiling.

Finally, we can see the demo of the program on the Android device.

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.