Android + cygwin + cocos2d-x Environment Construction

Source: Internet
Author: User

Http://15080452249-qq-com.iteye.com/blog/1762745

The first attempt to contact game development. It is said that the cocos2d-x is good and want to learn. On the network to find a lot of configuration, but found that some of the write is not clear, so I will write a record.


First you need several tools: JDK, Android SDK, Android ndk, Eclipse, cygwin, cocos2d-x package.
JDK, eclipse, and ADT installation will not be mentioned.
Android ndk: http://developer.android.com/tools/sdk/ndk/index.html
Cygwin: http://www.cygwin.com/
Cocos2d-x: http://cn.cocos2d-x.org/download

For cygwin installation instructions, refer to idea.
However, the last paragraph of this classmate's description is unclear. brother spent a day on it)
Original article:
Enter the cygwin directory in the command line and run cygwin. bat. If you are not using the Administrator account to log on to the system, a new folder named after your login name will be generated in the cygwin \ home \ folder.

Modify the new ". bash_profile" file in the folder, open it in a text editor such as UE or editplus, and add at last: (E/android-ndk-r8-windows/android-ndk-r8 is the path to install ndk)
Ndk_root =/cygdrive/e/android-ndk-r8-windows/android-ndk-r8
Export ndk_root

The specific meaning is as follows:
That is, whether the login user under your current window is admin. if not, the folder with your login name will be generated in the cygwin \ home \ directory, where you need to modify it. bash_profile file. otherwise, modify it directly in the cygwin \ home \ Administrator folder. bash_profile.
The modified content is as follows:
Add the ndk_root point to the. bash_profile file as follows:
Ndk_root =/cygdrive/e/android-ndk-r8-windows/android-ndk-r8
Export ndk_root
(Note: E/android-ndk-r8-windows/android-ndk-r8 for your ndk after decompression absolute path e for the edisk
Ndk storage path does not allow space such as program files this directory is not good because after running the cocos2d-x in the create-android-project.bat will appear prompt big meaning cygwin does not run what so extract please note)

Next to generate your cocos2d-x project, refer to the following link
Http://www.cnblogs.com/lhming/archive/2012/06/27/2566467.html
Notes:
You can use CD d to select the cygwin Folder: select a disk and then continue cd xx/x/xxxx.
If you are executing:
./Buile_native.sh the Please define ndk_root exception occurs. It proves that you configured
Ndk_root has a problem.

Import eclipse. It is found that org. cocos2dx is empty.

Two methods:

1. just copy the cocos2dx/platform/Android/Java/src folder under the root directory of the cocos2d-x engine to the SRC package of the project.

2. You can also import the cocos2dx/platform/Android/Java project to generate a jar file and add it to the libs folder of the project.

Both methods will copy the dependency to the APK when it is generated.


Well, thanks to all the netizens for their generous sharing ..

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.