Cocos2d-x 2.1.5 Android ndk compiling environment Configuration

Source: Internet
Author: User

The latest Android ndk does not need the support of cgywin, you can directly compile the source code of the cocos2d-x in win32 or 64 Environment,

But there are many other minor problems.

1. Do not use eclipse to directly view the. cpp file. If an error is detected, the file cannot be compiled successfully. It seems that it should be compiled using ndk without importing the header file. Gu cdt has an error during compilation.

2. Set the NDK_MODULE environment variable

After importing the project, start environment configuration. Click testcpp-> project-> propertis-> c ++ build,

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/1925212a7-0.png "style =" float: none; "title =" tu1.png "alt =" 110451556.png"/>

650) this. width = 650; "src =" http://img1.51cto.com/attachment/201310/110457214.png "style =" float: none; "title =" tu2.png "alt =" 110457214.png"/>

Modify build command to G: \ android \ ndk \ android-ndk-r9 \ ndk-build.cmd

Then, modify android. mk.

LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE := testcpp_sharedLOCAL_MODULE_FILENAME := libtestcppLOCAL_SRC_FILES := testcpp/main.cppLOCAL_C_INCLUDES := $(LOCAL_PATH)/../../ClassesLOCAL_WHOLE_STATIC_LIBRARIES := cocos_testcpp_commonLOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_staticLOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_staticLOCAL_WHOLE_STATIC_LIBRARIES += box2d_staticLOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_staticLOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_staticinclude $(BUILD_SHARED_LIBRARY)$(call import-add-path, G:/cocos2d-x-2.1.5)\$(call import-add-path, G:/cocos2d-x-2.1.5\cocos2dx\platform\third_party\android\prebuilt)\$(call import-module,samples/Cpp/TestCpp)$(call import-module,cocos2dx)$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libcurl)$(call import-module,CocosDenshion/android)$(call import-module,extensions)$(call import-module,external/Box2D)$(call import-module,external/chipmunk)

Then start compiling. If you have any questions, please leave a message.











This article is from the "Cocos2D-X" blog, please be sure to keep this source http://lonag.blog.51cto.com/3340984/1305060

Related Article

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.