[COCOS2DX Note 004] Android add? Static Library project

Source: Internet
Author: User

(based on 2.2.2 version number)
This step is more troublesome, not as good as the vs2013 set. There are a lot of articles. Still can't solve the problem. Just slowly groping. Posted here, hoping to make it possible for everyone to go a little detour.
It is also a sample of the mylib mentioned in the previous article. [COCOS2DX Note 003] Vs2013 add? Static Library project
first, go to External\mylib and hit Android.mk with a text editor.

and change the part of the circle in the diagram.

change results such as the following
Local_path: = $ (call My-dir) include $ (clear_vars) Local_module: = mylib_staticlocal_module_filename: = Libmyliblocal_ Src_files: = \src/mylibtest.cpp local_export_c_includes: = $ (local_path)/includelocal_c_includes: = $ (LOCAL_PATH)/ Includelocal_cflags: =-std=c99 include $ (build_static_library) Note: the $ (local_path) here is Android The folder where the. Mk is located.
In this way, a library project is OK, and the next step is to use it in your own project. My project is an example of a Xmtank demo.


The part of the red circle is. Then, in Project's source file or header file, include the header file for this static library.

It is then compiled and executed under Cygwin.



In this way, you can compile and use your static library in Android. I'm not doing anything like iOS, and I don't have this iosproject configuration yet.

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.