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