Win7/win8 build Configuration "vs2010", "COCOS2DX Environment", "Android platform"

Source: Internet
Author: User
Tags win32 python script visual studio 2010

"1, install VS2010"
recommended version of Microsoft Visual Studio 2010 Ultimate (2.5G) http://download.microsoft.com/download/E/0/4/ E0427bb8-8490-4c7f-a05b-afea0fc3ea80/x16-60997vs2010ultimtrialchs.iso Registration method: Method One: In the Control Panel version of the Uninstall Wizard enter the serial number (do not really uninstall) ycfhq-9dwcy-dkv88-t2tmh-g7bhp, method Two: After extracting the ISO to find Setup\ Setup.sdb, open with a notebook, find: [Product Key] yr3w8fcm2b7bkf9hmqftch7wk and replace Key with: ycfhq9dwcydkv88t2tmhg7bhp
"2, install Cocos2d-x"

Official website http://cocos2d-x.org/Download Cocos2d-x, for example "Cocos2d-x-2.2.3.zip (406M)", Unzip (C:\games\ cocos2d-x-2.2.3), double-click Cocos2d-win32.vc2010.sln,vs automatically open, in the solution can see a number of official examples, click on the selected Testcpp, right-click Set to start the project, clicking on the toolbar of the green triangle start, static wait n minutes, after the completion of the compilation of the simulator, Run demo.

2.1 Installing the VC template before you create the project "version 2.2"

A, locate the C:\cocos2d-2.1rc0-x-2.1.3\template\msvc\InstallWizardForVS2010.js file, and double-click Install.

"If the JS file cannot be run," the system default JS engine has been changed, rather than the system default Wscript.exe, modify the JS file open way for Wscript.exe (located under System32) "," Open Registry Editor, locate [HKEY_ Classes_root\.js] This item, double-click the default value to change it to "Jsfile"

b, open a new VS2010 program, and select File-New-project, select Visual C + +, cocos2dx-x, in the template COCOS2DX-WIN32 application, create a new HelloWorld project, the directory is placed under C:\cocos2d-2.1rc0-x-2.1.3\projects, otherwise you will not find cocos2d the corresponding library (workaround: C : \cocos2d-2.1rc0-x-2.1.3\cocos2dx and cocosdenshion The two folders are copied to HelloWorld, the C:\cocos2d-2.1rc0-x-2.1.3\ Static link library in Debug.win32: Libcocos2d.lib, libegl.lib 

Libgles_cm.lib, LibCocosDenshion.lib, Iconv.lib, libxml2. LIB, zlib1. Lib copy to the Helloworld\debug.win32 folder, the C:\cocos2d-2.1rc0-x-2.1.3\debug.win32 in the dynamic link library: Libcocos2d.dll, LibEGL.dll, Libgles_cm.dll, LibCocosDenshion.dll, Iconv.dll, Libxml2.dll, Zlib1.dll copy to helloworld\ Debug.win32 folder)

C, run the project, success.

2.2 Python Script creation project

A, download python first and install B, add the PATH environment variable, computer, properties, Control Panel \ All Control Panel items \ System, advanced system settings \ Advanced \ Environment variables, Locate path in the system variables bar, and edit at the top of the Python.exe with the path C:\Python27, separated by semicolons. C, open cmd input python, if there is a message that the installation is successful.  D, navigate to the C:\games\cocos2d-x-2.2.3\tools\project-creator file directory, enter the command "Python create_project.py-project Helloworld-package com.cocos2d-x.org-language cpp ", where Helloworld is the project name, Com.cocos2d-x.org is the package name, or use Notepad to create a Xxx.bat file save the above command, double-click Run directly to create the project. The created works are in the Cocos2d-x-2.2.3\projects directory.
 "3, install JDK"
A, according to the computer configuration (64-bit or 32-bit) download the corresponding JDK, website address: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html download Jdk-7u60-windows-x64.exe, double-click Install, all the way next, note the installation directory. B, configure environment variables. Create a new java_home and install the path "c:/java/jdk1.6.0_20" for the JDK. Edit path and add "%java_home%/bin;%java_home%/jre/bin" to the front of the value. The new classpath is the Java load class (class or Lib) path, set to ".; %java_home%/lib/dt.jar;%java_home%/lib/tools.jar "(note the previous.;).

C, in cmd input Java, check whether the installation is successful.

"3, install Android SDK, NDK"download Adt-bundle-windows-x86_64-20140321.zip, Android-ndk-r9d-windows-x86_64.zip and save the path, such as C:\android\ ( android-ndk-r9d, Eclipse, SDK, SDK Manager.exe).   "4, Eclipse compile project"1, start Eclipse.exe. Sets the default project path (C:\android\workspace). Set "Window", "Preferences",the "Android" SDK location:c:\android\sdk;ndk location:c:\android\android-ndk-r9d. 2. Import the HelloWorld project created earlier, "file", "Import", "Android/existing Android Code into Workspace", "Root Directory:" \ C Games\cocos2d-x-2.2.3\projects\hellocpp\proj.android "," and "finish". 3, copy the resource file, copy all the files under Helloworld\resources to the Helloworld\proj.android\assets directory4. Copy the Lib folder under the COCOS2D-X-2.2.3\COCOS2DX\PLATFORM\ANDROID\JAVA\SRC\ORG\COCOS2DX path to the HELLOWORLD\PROJ.ANDROID\SRC Under the \ORG\COCOS2DX. 5, configure the project properties. Right-click Project name "Properties"
A, resource->linked resource->new "cocos2dx = C:\games\cocos2d-x-2.2.3"
B, C + + Build: "Build command = C:\android\android-ndk-r9d\ndk-build.cmd"
C, environment-> "ADD" three variables: "cocos2dx=c:\games\cocos2d-x-2.2.3", "ndk_root=c:\android\android-ndk-r9d", "NDK _module_path=c:\games\cocos2d-x-2.2.3\cocos2dx\platform\third_party\android\prebuilt ".

6, modify HELLOWORLD\JNI\APPLICATION.MK, add a line app_platform: = android-8
7, modify HELLOWORLD\JNI\ANDROID.MK, add the CPP file name of project classes in Local_src_files, add two additional lines

$ (call Import-add-path, C:\games\cocos2d-x-2.2.3),
$ (call Import-add-path, C:\games\cocos2d-x-2.2.3\cocos2dx\platform\third_party\android\prebuilt)

8. Debugging Tools:

A. Create a new virtual appliance, Android virtual device manager,new, tick "use host GPU", otherwise you will not be able to execute the COCOS2DX application.
B, the real machine debugging needs to download the mobile phone Android version corresponding API version, click the toolbar Download button. http://www.crifan.com/summary_android_name_and_api_version_relation/9. Pack apk:A, the project directory of the Androidmanifest.xml file, modify the API version, <USES-SDK android:minsdkversion= "8"/>B, Android Tools--Export signed application package, after Setup is complete, wait a moment, the APK file appears under the path set, the transplant succeeds. C, in the export Android application This step, select the existing KeyStore, or create a new one (certificate to save good, otherwise the signature is different, can not upgrade the installation, only uninstall installation).

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.